Professional Documents
Culture Documents
value in arriving
❒ network vs transport layer connection service:
packet’s header ❍ network: between two hosts (may also involve
1
0111 intervening routers in case of VCs)
3 2 ❍ transport: between two processes
Example services for Example services for a Internet best effort none no no no no (inferred
flow of datagrams: via loss)
individual datagrams: ATM CBR constant yes yes yes no
❒ guaranteed delivery ❒ in-order datagram rate congestion
❒ guaranteed delivery delivery ATM VBR guaranteed yes yes yes no
rate congestion
with less than 40 msec ❒ guaranteed minimum
ATM ABR guaranteed no yes no yes
delay bandwidth to flow minimum
❒ restrictions on ATM UBR none no yes no no
changes in inter-
packet spacing
12 22 32
a VC consists of: 1
2
3
path 1 12 3 22
2 63 1 18
❒ packet belonging to VC carries VC number 3 7 2 17
(rather than dest address) 1 97 3 87
… … … …
❒ VC number can be changed on each link.
❍ New VC number comes from forwarding table
Routers maintain connection state information!
Network Layer 4-9 Network Layer 4-10
Datagram networks
Virtual circuits: signaling protocols
❒ no call setup at network layer
❒ routers: no state about end-to-end connections
❒ used to setup, maintain teardown VC
❍ no network-level concept of “connection”
❒ used in ATM, frame-relay, X.25
❒ packets forwarded using destination host address
❒ not used in today’s Internet ❍ packets between same source-dest pair may take
different paths
application
transport 5. Data flow begins 6. Receive data application application
transport application
network 4. Call connected 3. Accept call transport
network transport
data link 1. Initiate call 2. incoming call network
data link network
physical data link 1. Send data 2. Receive data
physical data link
physical
physical
otherwise 3
Physical layer:
bit-level reception
Data link layer: Decentralized switching:
e.g., Ethernet ❒ given datagram dest., lookup output port
see chapter 5 using forwarding table in input port
memory
❒ goal: complete input port processing at
‘line speed’
❒ queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Link layer
physical layer
IP datagram format
IP protocol version
IP Fragmentation & Reassembly
number 32 bits total datagram
length (bytes) ❒ network links have MTU
header length head. type of
(bytes) ver length (max.transfer size) - largest
len service for possible link-level frame.
“type” of data fragment fragmentation/
16-bit identifier flgs ❍ different link types, fragmentation:
offset reassembly
max number time to upper header different MTUs in: one large datagram
remaining hops live layer checksum ❒ large IP datagram divided out: 3 smaller datagrams
(decremented at (“fragmented”) within net
each router) 32 bit source IP address
❍ one datagram becomes
upper layer protocol 32 bit destination IP address several datagrams
reassembly
to deliver payload to E.g. timestamp, ❍ “reassembled” only at final
Options (if any)
record route destination
how much overhead data taken, specify ❍ IP header bits used to
with TCP? (variable length, list of routers identify, order related
❒ 20 bytes of TCP typically a TCP to visit. fragments
or UDP segment)
❒ 20 bytes of IP
❒ = 40 bytes + app
layer overhead
Network Layer 4-27 Network Layer 4-28
IP Fragmentation and Reassembly IP Addressing: introduction
223.1.1.1
length ID fragflag offset ❒ IP address: 32-bit
Example =4000 =x =0 =0 identifier for host, 223.1.2.1
223.1.1.2
❒ 4000 byte router interface 223.1.1.4 223.1.2.9
One large datagram becomes
datagram several smaller datagrams ❒ interface: connection
223.1.2.2
❒ MTU = 1500 bytes between host/router 223.1.1.3 223.1.3.27
length ID fragflag offset and physical link
=1500 =x =1 =0
1480 bytes in ❍ router’s typically have
data field length ID fragflag offset multiple interfaces 223.1.3.1 223.1.3.2
=1500 =x =1 =185 ❍ host typically has one
offset = interface
1480/8 length ID fragflag offset
=1040 =x
❍ IP addresses
=0 =370
associated with each 223.1.1.1 = 11011111 00000001 00000001 00000001
interface
223 1 1 1
IP Addressing Subnets
❒ Address can be divided in two parts
223.1.1.1
❒ IP address:
NetID HostID ❍ subnet part (high 223.1.2.1
223.1.1.2
order bits) 223.1.1.4 223.1.2.9
❒ NetID identifies the network ❍ host part (low order
IP Addresses Counting up
❒ 32 bit IP address:
given notion of “network”, let’s re-examine IP addresses: ❍ 232 = 4.294.967.296 theoretical IP addresses
“class-full” addressing: ❒ class A:
The IP
❍ 27-2 =126 networks [0.0.0.0 and 127.0.0.0 reserved] address
❍ 224-2 = 16.777.214 maximum hosts Pie!
class
• 2.113.928.964 addressable hosts (49,22% of max)
1.0.0.0 to ❒ class B
A 0 network host 127.255.255.255
❍ 214=16.384 networks Class B
B network 128.0.0.0 to Class A
10 host ❍ 216-2 = 65.534 maximum hosts
191.255.255.255
• 1.073.709.056 addressable hosts (24,99% of max) C
192.0.0.0 to
C 110 network host ❒ class C D
223.255.255.255 E
❍ 221=2.097.152 networks
224.0.0.0 to 28-2 = 254 maximum hosts
D 1110 multicast address
239.255.255.255
❍
• 532.676.608 addressable hosts (12,40% of max)
32 bits
193.17.31.76
193.17.31.55 193.17.31.45
193.17.31.76
193.17.31.55 193.17.31.45
193.17.31.0
193.17.31.0
200.23.16.0/23
Network Layer 4-39 Network Layer 4-40
DHCP: Dynamic Host Configuration Protocol DHCP client-server scenario
Goal: allow host to dynamically obtain its IP address
from network server when it joins network DHCP 223.1.2.1
A 223.1.1.1
Can renew its lease on address in use server
Allows reuse of addresses (only hold address while connected 223.1.1.2
an “on”) 223.1.1.4 223.1.2.9
Support for mobile users who want to join network (more B
223.1.2.2 arriving DHCP
shortly) 223.1.1.3 223.1.3.27 E client needs
DHCP overview: 223.1.3.2
address in this
223.1.3.1 network
❍ host broadcasts “DHCP discover” msg
❍ DHCP server responds with “DHCP offer” msg
❍ host requests IP address: “DHCP request” msg
❍ DHCP server sends address: “DHCP ack” msg
Network Layer 4-41 Network Layer 4-42
from
from
from
from
y ∞∞ ∞ y 2 0 1 y ∞∞ ∞ y 2 0 1 y 2 0 1
z ∞∞ ∞ z 7 1 0 z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table node y table
cost to cost to cost to cost to
x y z y x y z x y z x y z y
2 1 2 1
x ∞ ∞ ∞ x ∞ ∞ ∞ x 0 2 7 x 0 2 3
x z x z
from
from
from
from
y 2 0 1 7 y 2 0 1 y 2 0 1 y 2 0 1 7
z ∞∞ ∞ z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table node z table
cost to cost to cost to cost to
x y z x y z x y z x y z
x ∞∞ ∞ x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
from
from
y ∞∞ ∞ y ∞∞ ∞ y 2 0 1 y 2 0 1
z 71 0 z 71 0 z 3 1 0 z 3 1 0
time time
Network Layer 4-73 Network Layer 4-74
Distance Vector: link cost changes Distance Vector: link cost changes
Link cost changes: Link cost changes:
1 60
❒ node detects local link cost change y ❒ good news travels fast y
4 1 ❒ bad news travels slow - 4 1
❒ updates routing info, recalculates
x z “count to infinity” problem! x z
distance vector 50 50
❒ if DV changes, notify neighbors ❒ 44 iterations before
algorithm stabilizes: see
At time t0, y detects the link-cost change, updates its DV, text
and informs its neighbors.
“good Poisoned reverse:
At time t1, z receives the update from y and updates its table.
news ❒ If Z routes through Y to
It computes a new least cost to x and sends its neighbors its DV.
travels get to X :
fast” At time t2, y receives z’s update and updates its distance table. ❍ Z tells Y its (Z’s) distance
y’s least costs do not change and hence y does not send any to X is infinite (so Y won’t
message to z. route to X via Z)
❒ will this completely solve
count to infinity problem?
Network Layer 4-75 Network Layer 4-76
Comparison of LS and DV algorithms Hierarchical Routing
Message complexity Robustness: what happens
❒ LS: with n nodes, E links, if router malfunctions?
O(nE) msgs sent LS:
❒ DV: exchange between
❍ node can advertise
neighbors only
incorrect link cost
❍ convergence time varies
❍ each node computes only
Speed of Convergence its own table
❒ LS: O(n2) algorithm requires DV:
O(nE) msgs ❍ DV node can advertise
❍ may have oscillations incorrect path cost
❒ DV: convergence time varies ❍ each node’s table used by
❍ may be routing loops
others
• error propagate thru
❍ count-to-infinity problem
network
Network Layer 4-77 Network Layer 4-78
BGP routing policy (2) Why different Intra- and Inter-AS routing ?
legend: provider Policy:
B network
X ❒ Inter-AS: admin wants control over how its traffic
W A
customer routed, who routes through its net.
C network:
❒ Intra-AS: single admin, so no policy decisions needed
Y
Scale:
❒ A advertises path AW to B ❒ hierarchical routing saves table size, reduced update
❒ B advertises path BAW to X traffic
❒ Should B advertise path BAW to C? Performance:
❍ No way! B gets no “revenue” for routing CBAW ❒ Intra-AS: can focus on performance
since neither W nor C are B’s customers ❒ Inter-AS: policy may dominate over performance
❍ B wants to force C to route to w via A
❍ B wants to route only to/from its customers!
Network Layer 4-111 Network Layer 4-112