Lec21 Networking
Lec21 Networking
Networking
Queue Queue
Inputs Outputs
Queue Queue
Queue Queue
Control
(processor)
Switch
Switch
Switch
3
2
1
• Networking
– Network Protocols
Other
subnets
subnet1
Transcontinental
Router Link
Router
Other
subnets Router subnet3
subnet2
• Exam reminders:
– MIDTERM II: April 26th
» All material from last midterm and up to Monday 4/24
» Lectures #13 – 24
UDP Data
Router Router
• Contributions to Latency
– Wire latency: depends on speed of light on wire
» about 1–1.5 ns/foot
– Router latency: depends on internals of router
» Could be < 1 ms (for a good router)
» Question: can router handle full wire throughput?
4/12/06 Joseph CS162 ©UCB Spring 2006 Lec 21.20
BREAK
Sample Computations
• E.g.: Ethernet within Soda
– Latency: speed of light in wire is 1.5ns/foot, which
implies latency in building < 1 μs (if no routers in path)
– Throughput: 10-1000Mb/s
– Throughput delay: packet doesn’t arrive until all bits
» So: 4KB/100Mb/s = 0.3 milliseconds (same order as disk!)
• E.g.: ATM within Soda
– Latency (same as above, assuming no routing)
– Throughput: 155Mb/s
– Throughput delay: 4KB/155Mb/s = 200μ
• E.g.: ATM cross-country
– Latency (assuming no routing):
» 3000miles * 5000ft/mile ⇒ 15 milliseconds
– How many bits could be in transit at same time?
» 15ms * 155Mb/s = 290KB
– In fact, Berkeley→MIT Latency ~ 45ms
» 872KB in flight if routers have wire-speed throughput
• Requirements for good performance:
– Local area: minimize overhead/improve bandwidth
– Wide area: keep pipeline full!
ack
• How to ensure transmission of packets?
– Detect garbling at receiver via checksum, discard if bad
– Receiver acknowledges (by sending “ack”) when packet
received properly at destination
– Timeout at sender: if no ack, retransmit
• Some questions:
– If the sender doesn’t get an ack, does that mean the
receiver didn’t get the original message?
» No
– What it ack gets dropped? Or if message gets delayed?
» Sender doesn’t get ack, retransmits. Receiver gets
message twice, acks each.
4/12/06 Joseph CS162 ©UCB Spring 2006 Lec 21.24
How to deal with message duplication
• Solution: put sequence number in message to identify
re-transmitted packets
– Receiver checks for duplicate #’s; Discard if detected
• Requirements:
– Sender keeps copy of unack’ed messages
» Easy: only need to buffer messages
– Receiver tracks possible duplicate messages
» Hard: when ok to forget about received message?
• Simple solution: Alternating-bit protocol
– Send one message at a time; don’t send A B
Pkt #
next message until ack received 0
– Sender keeps last message; receiver c k #0
tracks sequence # of last message received A
Pkt #
• Pros: simple, small overhead 1
• Con: Poor performance c k #1
A
– Wire can hold multiple messages; want to Pkt #
fill up at (wire latency × throughput) 0
• Con: doesn’t work if network can delay c k #0
A
or duplicate messages arbitrarily
4/12/06 Joseph CS162 ©UCB Spring 2006 Lec 21.25
Conclusion
• Network: physical connection that allows two
computers to communicate
– Packet: sequence of bits carried over the network
• Broadcast Network: Shared Communication Medium
– Transmitted packets sent to all receivers
– Arbitration: act of negotiating use of shared medium
» Ethernet: Carrier Sense, Multiple Access, Collision Detect
• Point-to-point network: a network in which every
physical wire is connected to only two computers
– Switch: a bridge that transforms a shared-bus
(broadcast) configuration into a point-to-point network.
• Protocol: Agreement between two parties as to how
information is to be transmitted
• Internet Protocol (IP)
– Used to route messages through routes across globe
– 32-bit addresses, 16-bit ports
• Reliable, Ordered, Arbitrary-sized Messaging:
– Built through protocol layering on top of unreliable,
limited-sized, non-ordered packet transmission links
4/12/06 Joseph CS162 ©UCB Spring 2006 Lec 21.26