Title: Communication Networks
1Communication Networks
2Lookups RDT
3Lookup and Forwarding Engine
Packet
header
payload
Router
Routing Lookup Data Structure
Destination Address
Outgoing Port
Forwarding Table
Destination
Port
65.0.0.0/8
3
128.9.0.0/16
1
149.12.0.0/19
7
4Example Forwarding Table
Destination IP Prefix Outgoing Port
65.0.0.0/ 8 3
128.9.0.0/16 1
142.12.0.0/19 7
Prefix length
IP prefix 0-32 bits
142.12.0.0/19
128.9.0.0/16
65.0.0.0/8
0
232-1
224
65.0.0.0
65.255.255.255
5Prefixes can Overlap
Longest matching prefix
128.9.176.0/24
128.9.16.0/21
128.9.172.0/21
142.12.0.0/19
65.0.0.0/8
128.9.0.0/16
0
232-1
Find the longest matching prefix among all
prefixes that match the destination address.
6LPM in IP RoutersUsing 32 exact match algorithms
for LPM!
Exact match against prefixes of length 1
Exact match against prefixes of length 2
Port
Priority Encode and pick
Exact match against prefixes of length 32
7LPM in IP RoutersBinary tries
Example Prefixes
0
1
a) 00001
b) 00010
c) 00011
d) 001
e) 0101
g
f
d
f) 011
g) 100
h
i
h) 1010
e
i) 1100
j) 11110000
a
b
c
j
8LPM in IP RoutersPatricia trie
Example Prefixes
0
1
a) 00001
b) 00010
c) 00011
d) 001
e) 0101
g
f
d
j Skip 5 1000
f) 011
g) 100
h
i
h) 1010
e
i) 1100
j) 11110000
a
b
c
9Binary Search
100000 101000 101010 101011 101111 111111
A
B
B
C
A
(exact match)
101011
(range match)
111110
A 1 B 101 C 10101
Each prefix is encoded as a range, find
narrowest enclosing range.
13
10Reliable Transmission
- How do we send a packet reliably when it can be
lost and/or corrupted in the network? - Mechanisms
- Acknowledgements
- Timeouts
- Simplest reliable protocol Stop and Wait
- send a packet
- stop and wait until an ACK arrives from the
receiver - retransmit if timeout occurs before ACK arrives
11Stop and Wait
12Recovering from Errors
13Problems with Stop and Wait
- How does the receiver recognize a duplicate
transmission (e.g. in the case of a lost ACK)? - Solution Put sequence number in packet
- Performance
- No pipeline effect
- Example
- For a l.5 Mbps link with 45 ms RTT
- Bandwidth-delay product 67.5 Kb (8KB)
- 1KB packets imply 1/8th link utilization
14Sequence Numbers
- Detect retransmissions using sequence numbers
- both packets and ACKs
- Sequence in packet is finite
- How many bits do we need?
- 1 bit for stop and wait
- Wont send seq 1 until receive ACK for seq 0
15What if packets are reordered?
- Never reuse a seq ? Finite
- Require in order delivery? Unreliable network
- Prevent very late delivery?
- TTL Decrement hop count per packet, discard if
exceeded - Seq not reused within delay bound