Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Network Layer: IP Addressing and Forwarding - CS 242, Wellesley College, Fall 2007, Study Guides, Projects, Research of Computer Systems Networking and Telecommunications

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

Pre 2010

Uploaded on 08/16/2009

koofers-user-d5t
koofers-user-d5t 🇺🇸

10 documents

1 / 33

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Network Layer:
Addressing and
forwarding
CS 242: Computer Networks
Week 09: Monday, 11/05/07
Daniel Bilar
Wellesley College
Fall 2007
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21

Partial preview of the text

Download Network Layer: IP Addressing and Forwarding - CS 242, Wellesley College, Fall 2007 and more Study Guides, Projects, Research Computer Systems Networking and Telecommunications in PDF only on Docsity!

Network Layer:Addressing andforwarding

CS 242: Computer NetworksWeek 09: Monday, 11/05/07Daniel BilarWellesley CollegeFall 2007

Goals today 

Progress report, project proposals

How routers forward packets



Longest Prefix matching with Patricia tree

IP is the “lingua franca” of the Internet



How hosts obtain information needed toparticipate: the DHCP protocol

Some slides adapted and pictures gratefully

acknowledged from Kurose, Schul,Rexford

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)

Review: Grouping Related Hosts 

The Internet is an “inter-network”



Used to connect

networks

together, not

hosts



Needs a way to address a network (i.e., groupof hosts)

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.

IP Mask: 255.254.0.

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/

AND

Key Functions of IP Layer

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 ..

Possibility: Entries Per Address 

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

Possibility: Entry per class 

If the router had an entry per classful prefix



Mixture of Class A, B, and C addresses



Depends on the first couple of bits of the destination



Identify the mask automatically from theaddress



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)



Then, look in the forwarding table for the match



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

CIDR and forwarding 

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

Simplest Algorithm is Too Slow 

Scan the forwarding table one entry at a time



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



Overhead is linear in size of the forwarding table



Today, that means 150,000-200,000 entries!



And, the router may have just a few nanoseconds



… before the next packet is arriving



Need greater efficiency to keep up with line rate



Better algorithms



Hardware implementations

A “Patricia” Tree (1988) 

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? 

Where do the table entries come from? Recall:Routers map prefix to outgoing link(s)



Entries can be statically configured



E.g., “map 12.34.158.0/24 to Serial0/0.1”



But this doesn’t adapt or scale to failures, newequipment, load balancing!



That is where DHCP, ARP



And routing protocols (BGP, OSPF) we’ll see soon

DHCP: How host learns its address

Q:

How does host get IP

address (subnet +host part)?



Hard-coded by systemadmin in a file



Windows: control-panel->network->configuration->tcp/ip->properties



DHCP: D

ynamic

H

ost

C

onfiguration

P

rotocol



ARP: Address Resolutionprotocol (we’ll see thismore in coming lecture)