Computer Networks Week 4 Corboy Law 522
Read:
Chapter 1: 1.1-1.3, 1.5
Chapter 2: 2.1-2.6, 2.8.2 (wi-fi)
2.6: Ethernet
See also my notes (link on course home page).
Ethernet: Read section 2.6 on Ethernet
Logical: point-to-point
Physical: broadcast bus
(not counting switching)
Packet format:
destaddr
6 bytes
|
srcaddr
6 bytes
|
type
2 bytes
|
data
min: 42 bytes (data is padded as necessary) max: 1500 bytes
|
crc-32
4 bytes
|
The Network Interface (NI, or Ethernet card) interrupts CPU if any of the following apply:
- packet destaddr matches NI's physical addr
- packet destaddr is b'cast address ff:ff:ff:ff:ff:ff
- packet destaddr is multicast and NI has "subscribed" to that m'cast addr
- NI is in promiscuous mode
That covers RECEIVING; what about SENDING?
Why we need a TYPE field
Similarities to 802.11 wifi packet format: srcaddr/destaddr/type are the same; wifi radio headers have additional fields for the associated access point.
Ethernet (addresses, collisions, performance)
traditional broadcast-bus; role of hub
True eavesdropping story:
In 1994 I changed the admin password on
several remote unix machines, using telnet. I told no one. Within two
hours, someone else logged into one of the remote machines, using the
new password, from inria.fr (then rife with hackers, as I suppose was
Loyola). Two months later was the Kevin Mitnick "Christmas Day Attack",
launched from apollo.it.luc.edu.
- physical addresses, bcast address
- operation of sending
- csma/cd
- collisions
- how CD (collision detect) works
- Signal propagation on the line: 1 bit = 23 m for 10 megabit
- min packet size / max diameter requirement[!]
- SLOT TIME:
compare min-packet requirement to max packet size
repeaters
These are simple amplifiers. The original intent was to allow for
longer segments, by providing enough amplification that the signal
would still be strong enough to allow for collision detection at the
remote end.
It was soon realized that multi-port repeaters allow a change in the geometry too. Multiport repeaters are often called hubs. Hubs are slowly being phased out in favor of switches.
Collisions and hubs: simple digital sensing
Collisions and switches: occur
only if both ends want to transmit at the same time. This is relatively
common during a busy file transfer, as the sender always has more data
to send and the receiver has a steady supply of TCP Acks to send.
However, the impact on overall throughput is minimal!
Two issues relating to cable length:
faintness of signal
(addressed by repeaters)
window of opportunity for an undetected
collision (related to max network diameter)
scaling to 100Mbps; min packet revisited
collisions and hubs
collisions and switches
Exponential backoff algorithm
Stations transmit immediately
when the line is free. This leads to a
collision if we were waiting for the line to become free, and someone
else was waiting also. This is not considered a problem, however;
Ethernet collisions are considered to be a relatively inexpensive way
of sorting out who gets to send next. Transmitting with probability 1 as soon as the line is clear is known as 1-persistence.
Ethernet defines the slot time to be 51.2 µsec:
- the notional RTT (the actual RTT is rather smaller)
- the time needed to send a minimum packet
After N collisions (including N=1):
- choose a random k, 0<=k<2N (choose an N-bit random k)
- wait k slot times
- try again to transmit. Options: idle/seize_channel, idle/collide, busy
Ethernet can be modeled as an alternating sequence of packet transmissions and contention intervals,
where the latter can be subdivided into slot-time subintervals that are
each idle or contain a collision. At low utilization, most of the
contention interval may be idle, and the division into slots may be
unnecessary. The interesting case, however, is when there is always at
least one packet ready to send, in which case idle slots exist only
because of random variation in the backoff.
In general, if M stations are waiting to transmit, it takes O(M) slot
times (and O(log M) collisions) before one station succeeds. My
informal simulations suggest that one station usually succeeds after
M/2 slot times.
hidden bias against hosts that have been waiting longest: "unfairness"
Timeline of typical exponential backoff
Ethernet myths re capacity
Ethernet v Wireless (wifi)
Both have exponential backoff. Wireless, however, cannot detect collisions in progress.
This has to do with the relative signal strength of the remote signal
at the local transmitter; along a wire-based Ethernet the remote signal
might be as week as 1/100 of the transmitted signal but that 1%
variation is still detectable. However, with radio the remote signal
might be as week as 1/100,000 of the transmitted signal, and it is
simply lost.
Recall that Ethernet uses the lack of a detected collision as evidence
the packet was delivered successfully. Wifi can't do this, so it adds
link-layer ACK packets (unrelated to the later TCP ACK), at least for
unicast transmission. Although wifi cannot do collision detection, it does
have a much smaller RTT (~1-2 µsec versus the official 51.2 µsec for
Ethernet (even fast)). Wifi takes advantage of this by having the
link-layer ACK sent only 10 µsec after the sender stops (802.11b/g).
The next regular packet, on the other hand, waits ~50µsec. Because
there is only one station that wants to send a link-layer ACK, this ACK
will never collide with anything.
Wifi collisions, unlike Ethernet, are expensive. To deal with this,
senders wait a full 50 µsec after first sensing the medium to be sure
it is idle. If no other traffic is seen in this interval, the station
may then transmit immediately. However, if other traffic is sensed
(and, most likely, waited for), then the station must do an exponential
backoff even for the first packet. Furthermore, the initial backoff is
to choose k<25 (Ethernet in effect chooses an initial backoff of k<20 = 1; ie k=0).
Wifi stations optionally also use a request-to-send/clear-to-send
(RTS/CTS) protocol. Usually they use this only for larger packets;
often, the RTS/CTS "threshold" is set to be the maximum packet size, or
is otherwise disabled.
One of the rationales for the RTS/CTS protocol is the "hidden node
problem", P&D 139. If every station has a 100-meter range, and
stations A and B are each 75 meters from C, and are arranged linearly
in space as A---C---B, then A and B cannot hear each others'
transmissions at all, not while they are themselves transmitting and
not even when they are themselves idle. However, if A and B were to simultaneously transmit to C, then a collision would occur and C would receive nothing.
Ethernet BRIDGING
Why switching avoids collisions, mostly
Half-duplex: data flows in one direction at a time
Full-duplex: packets can be sent in opposite directions
simultaneously; collision-free! This is usually implemented via two
half-duplex lines, each with a dedicated direction.
Bridge Learning: first look
2.7: FDDI. Omit, except for brief discussion of token idea.
Tokens
Fairness, round-robin allocation
uniform performance under heavy loads
Basics of Datagram Routing
A--S1-----S2--D
| |
| |
B--S3-----S4----S5---F
| |
C E
Basics of Adaptive (Learning) Bridges (Ethernet Switches)
- table size issues
- table updates
- learning algorithm
- b'cast as fallback
- bridges v hubs
- problem of cycles; spanning-tree algorithm
Peterson & Davie 3.2:
Bridges and Adaptive Bridges; cycles; scalability
Bridges join separate physical ethernets.
Packets are propagated, but collisions are not.
Limit to total size: total traffic
Limits to size: b'cast, table sizes (104 v. 106)
Cannot use loop topology
Delay (we don't want packets arriving late)
bridges & security: other parties cannot listen in.
There is lots of debate in the networking community regarding the
point at which one should convert from switching (bridging) to IP
routing. IP routers are relatively slow, so there is some pressure to
switch instead.
3.1.2: virtual circuit switching
The road not taken by IP.
In VC switching, routers know about end-to-end connections. To send a
packet, a connection needs to be established first. For that
connection, each link is
assigned a "connection ID" (traditionally called the VCI, for Virtual
Circuit Identifier). To send a packet, the host marks the packet with
the VCI assigned to the host--router1 link.
More next week.