Professional Documents
Culture Documents
Your Future?
Who is planning to go to grad school (in CS)? Who is interested in research possibilities?
Regrading of Homework
Requests for regrading must be made within one week of when the work was returned.
Without this page, your work will not be regraded. Your entire homework may be regraded
Score could decrease, stay the same, or increase
Other Announcements
Wont finish topic (links/LANs) today
It is your responsibility to slow me down Ask questions, yawn loudly, snore, whatever it takes!
Link-Layer Services
host
HTTP
TCP router IP
IP packet
TCP
IP
IP
IP packet
IP
Ethernet interface
Ethernet interface
SONET interface
SONET interface
Ethernet interface
Ethernet interface
Ethernet frame
SONET frame
Ethernet frame
Ethernet frame
SONET frame
Ethernet frame
What functions these technologies provide How they implement those functions
Adaptor-to-Adaptor Communication
datagram
adaptor
Sending side:
Encapsulates datagram in a frame Determines local addressing, adds error checking, controls transmission
Receiving side
Recognizes arrival, looks for errors, possibly acknowledges Extracts datagram and passes to receiving node
9
Link-Layer Services
Encoding
Representing the 0s and 1s
Framing
Encapsulating packet into frame, adding header, trailer Using MAC addresses rather than IP addresses
Error detection
Errors caused by signal attenuation, noise Receiver detects presence, may ask for repeat (ARQ)
Resolving contention
Deciding who gets to transmit when multiple senders want to use a shared media
10
Framing
Specify how blocks of data are transmitted between two nodes connected on the same
physical media
Service provided by the data link layer Implemented by the network adaptor
Challenges
Decide when a frame starts & ends How hard can that be?
11
53
Frame contents
53 bytes of data
21
Frame contents
21 bytes of data
Frame 94 contents
Bogus new frame length; desynchronization 12
Desynchronization
Once framing is desynchronized, stays that way Need a method to resynchronize But once we have that method, why use counting?
13
Framing: Sentinels
Delineate frame with special pattern
01111110 Frame contents
Problem: what if sentinel occurs within frame? Solution: escape the special characters
E.g., sender always inserts a 0 after five 1s receiver always removes a 0 appearing after five 1s
Example
01111110 0111111011111011111001 01111111
Sender: Five 1s insert a 0
Start frame
End frame
16
17
NRZ encoding
To avoid long sequences of 0s or 1s payload is XOR-ed with special 127-bit pattern w/ many 0-1/1-0 transitions
18
Error Detection
Errors are unavoidable
Electrical interference, thermal noise, etc.
Error detection
Transmit extra (redundant) information Use redundant information to detect errors Extreme case: send two copies of the data Trade-off: accuracy vs. overhead
20
21
Used by most modern link layers See K&R Section 5.2.3 Why do links use CRC but IP uses checksum?
22
23
24
Classes of techniques
Channel partitioning: divide channel into pieces Taking turns: scheme for trading off who gets to transmit Random access: allow collisions, and then recover
o Optimizes for the common case of only one sender
25
Slots = 0 1 2 3 4 5
0 1 2 3 4 5
26
FDM cable
27
master
data
Concerns:
Token overhead Latency At mercy of any node
slaves
Concerns:
Polling overhead Latency Single point of failure (master)
28
Latency?
No!
Reliability?
Yes!
29
5 Minute Break
30
31
Examples
ALOHA and Slotted ALOHA CSMA, CSMA/CD, CSMA/CA (wireless, covered later)
32
Collision detection
If someone else starts talking at the same time, stop Realizing when two nodes are transmitting at once by detecting that the data on the wire is garbled
Randomness
Dont start talking again right away Waiting for a random time before trying again
33
Broadcast:
34
Slotted ALOHA
Assumptions All frames same size Time divided into equal slots (time to transmit a frame) Operation When node gets fresh data, transmits in next slot No collision: success! Collision: node retransmits frame in each subsequent slot with probability p until success
Slot-by-Slot Example
36
Limiting behavior:
For fixed p, S 0 as N increases But if p = 1/N, then S 1/e = 0.37 as N increases
Pros
Cons
Wasted slots:
Idle Collisions
Nodes should detect collision in less than time to transmit packet Clock synchronization
38
39
40
CSMA Collisions
Collisions can still occur:
propagation delay means two nodes may not hear each others transmission in time. At time t1, D still hasnt heard Bs signal sent at the earlier time t0, so D goes ahead and transmits: failure of carrier sense.
41
42
45
Performance of CSMA/CD
Time wasted in collisions
Proportional to d
Efficiency ~ 1/(1+5d/p)
For large packets, small distances, E ~ 1
Game Theory?
What happens when one node has CD and the other doesnt? When do we see this in real life?
47
48
Preamble: synchronization
Seven bytes with pattern 10101010, followed by one byte with pattern 10101011 Used to synchronize receiver & sender
Data:
Maximum: 1,500 bytes Minimum: 46 bytes (+14 bytes header + 4 byte trailer = 512 bits)
51
Ethernet, cont
Connectionless
No handshaking between sending and receiving adapter
Unreliable
Receiving adapter doesnt send ACKs or NACKs Packets passed to network layer can have gaps Gaps will be filled if application is using TCP Otherwise, application will see the gaps
Benefits of Ethernet
Easy to administer and maintain Inexpensive Increasingly higher speed Evolvable
53
Evolution of Ethernet
From shared media to switches
Why?
55
56
Superlinear polynomial:
Channel capture Efficiency is 1 (for any finite N)
Sublinear polynomial:
No channel capture Efficiency is less than 1 (and goes to zero for large N)
57
Next Lecture
Finish up Links and LANs
Ethernet: spanning multiple segments Spanning trees
Remember:
HW #2 due Project 1A due Requests for regrades due
58