

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This document from a computer networks course at wellesley college covers ip addressing and forwarding at the network layer. Topics include longest prefix matching with patricia tree, subnets, classless inter-domain routing (cidr), and the dynamic host configuration protocol (dhcp).
Typology: Study Guides, Projects, Research
1 / 33
This page cannot be seen from the preview
Don't miss anything!
CS 242: Computer NetworksWeek 09: Monday, 11/05/07Daniel BilarWellesley CollegeFall 2007
Review: IP layer responsibilities
forwarding
table
Routing protocols •path selection•RIP, OSPF, BGP
IP protocol •addressing conventions•datagram format•packet handling conventions
ICMP protocol •error reporting•router “signaling”
Transport layer: TCP, UDP
Link layer
physical layer
Network
layer
The Network ‘IP’ layer’s job is to permit hosts to inject packetsinto
any
network and have them travel independently to the
destination (potentially on different types of networks)
host
host
host
LAN 1
...
host
host
host
LAN 2
...
router
router
router
WAN
WAN
LAN = Local Area NetworkWAN = Wide Area Network
Review: Classless Inter-Domain Routing IP Address : 12.4.22.
Address
Mask
for hosts
Network Prefix
Use two 32-bit numbers to represent a network.
Network number = IP address + Mask
Written as 12.4.0.0/
Routing:
Determine
route taken by packetsfrom source to dest.
Process of planning tripfrom source to destination
We’ll see more of this with routing algorithms
Forwarding:
Move
packets from router’sinput to appropriaterouter output
Process of getting throughsingle interchange
See it today
☺
1 2
3
0111
value in arrivingpacket’s header
routing algorithm
local forwarding table
header value output link
0100010101111001
3 2 2 1
What prefixes and
subnet masks areused for ..
If a router had a forwarding entry per IP address and notsubnet
Match
destination address
of incoming packet
… to the
forwarding-table entry
… to determine the
outgoing interface
host
host
host
LAN 1
...
host
host
host
LAN 2
...
router
router
router
WAN
WAN
1.2.3.
5.6.7.
2.4.6.
1.2.3.
5.6.7.
2.4.6.
1.2.3.4^ 1.2.3. forwarding table
Mixture of Class A, B, and C addresses
Depends on the first couple of bits of the destination
First bit of 0: class A address (/8)
First two bits of 10: class B address (/16)
First three bits of 110: class C address (/24)
E.g., 1.2.3.4 maps to 1.2.3.0/
Then, look up the entry for 1.2.3.0/
… to identify the outgoing interface
Tradeoff
CIDR allows efficient use of the limited address space but CIDRmakes packet forwarding much harder
Forwarding table
may have many matches
E.g., table entries for 201.10.0.0/21 and 201.10.6.0/
The IP address 201.10.6.17 would match
both
!
201.10.0.0/
201.10.0.0/
201.10.4.0/
201.10.5.0/
201.10.6.0/
Provider 1
Provider 2
See if the destination matches the entry
If so, check the size of the mask for the prefix
Keep track of the entry with longest-matching prefix
Today, that means 150,000-200,000 entries!
And, the router may have just a few nanoseconds
… before the next packet is arriving
Better algorithms
Hardware implementations
Practical Algorithm to Retrieve Information Coded in Alphanumeric
Store the prefixes as a tree
One bit for each level of the tree
Some nodes correspond to valid prefixes
... which have next-hop interfaces in a table
When a packet arrives
Traverse the tree based on the destination address
Stop upon reaching the longest matching prefix
0
1
00
10
11
100
101
Genesis of Forwarding Tables?
E.g., “map 12.34.158.0/24 to Serial0/0.1”
And routing protocols (BGP, OSPF) we’ll see soon
DHCP: How host learns its address
Hard-coded by systemadmin in a file
Windows: control-panel->network->configuration->tcp/ip->properties
ynamic
ost
onfiguration
rotocol
ARP: Address Resolutionprotocol (we’ll see thismore in coming lecture)