Network Layer.ppt
-
Upload
rashed-sobuj -
Category
Documents
-
view
222 -
download
0
Transcript of Network Layer.ppt
-
7/29/2019 Network Layer.ppt
1/22
Network Layer
Lecture # 2
MAHS
-
7/29/2019 Network Layer.ppt
2/22
4: Network Layer 4b-2
Hierarchical Routing
scale: with 200 milliondestinations:
cant store all dests inrouting tables!
routing table exchange
would swamp links!
administrative autonomy internet = network of
networks each network admin may
want to control routing (costmetrics, etc.) in its ownnetwork
Our routing study thus far - idealization all routers identical
network flat
nottrue in practice
Why?
-
7/29/2019 Network Layer.ppt
3/22
4: Network Layer 4b-3
Hierarchical Routing
Organization:aggregate routers intoregions,calledautonomous systems
(AS) routers in same AS run
same routing protocol intra-AS routing (i.e.,
within an AS) protocol routers in different AS
can run different intra-AS routing protocol
special routersin (onthe edgeof) an AS
run intra-AS routingprotocol with all otherrouters in AS
alsoresponsible forrouting to destinationsoutside AS run inter-AS routing
(i.e., between AS)protocol with othergateway routers
gateway routers
-
7/29/2019 Network Layer.ppt
4/22
4: Network Layer 4b-4
Intra-AS and Inter-AS routing
Gateway routers:perform inter-ASrouting amongstthemselvesperform intra-AS
routing with otherrouters in theirAS
inter-AS, in
tra-ASrouting ingateway A.c
network layer
data link layerphysical layer
a
b
b
aaC
A
B
d
A.a
A.c
C.b
B.a
c
b
c
-
7/29/2019 Network Layer.ppt
5/22
4: Network Layer 4b-5
Intra-AS and Inter-AS routing
Hosth2
a
b
b
aa
C
A
Bd c
A.a
A.c
C.bB.a
c
bHosth1
Intra-AS routingwithin AS A
Inter-ASroutingbetweenA and B
Intra-AS routingwithin AS B
Well examine specific inter-AS and intra-ASInternet routing protocols shortly (section 4.5)
-
7/29/2019 Network Layer.ppt
6/22
4: Network Layer 4b-6
IP datagram format
ver length
32 bits
data(variable length,
typically a TCP segment,a UDP segment,
or an ICMP message)
16-bit identifier
Headerchecksum
time tolive
32 bit source IP address
IP protocol versionnumber
header length(4-byte multiples)
max numberremaining hops
(decremented ateach router)
forfragmentation/reassembly
total datagram
length (bytes)
upper layer protocolto deliver payload to
(RFC 1700, 3232)
head.len
type ofservice
DS codepoint, ECNflgs
fragment
offsetupper
layer
32 bit destination IP address
Options (if any) E.g. timestamp,record route
taken, specifylist of routersto visit.
how much overheadwith TCP?
20 bytes of TCP
20 bytes of IP
= 40 bytes + app
layer overhead
-
7/29/2019 Network Layer.ppt
7/22
4: Network Layer 4b-7
IP Fragmentation & Reassembly
network links have MTU (Max.Transfer Unit) size - largestpossible link-level frame.
different link types,different MTUs
large IP datagram is divided
(fragmented) within network one datagram becomes
several datagrams
reassembled only at thefinal destination
IP header bits are used toidentify and order relatedfragments
fragmentation:in: one large datagramout: 3 smaller datagrams
reassembly
-
7/29/2019 Network Layer.ppt
8/22
4: Network Layer 4b-8
IP Fragmentation and ReassemblyID
=x
offset
=0
More bit
=0
bytes*
=3980
ID=x offset=0More bit=1bytes*=1480
ID=x
offset=1480
More bit=1
bytes*=1480
ID=x offset=2960More bit=0bytes*=1020
One large datagram becomesseveral smaller datagrams
Note: Offset is actuallyspecified as number of8-byte (64-bit) units.
Example
4000 byte
datagram MTU = 1500 bytes
* This is the number ofdata bytes in the IPdatagram. The IP lengthfield would show this +20. Why?
-
7/29/2019 Network Layer.ppt
9/22
4: Network Layer 4b-9
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamicallyobtain its IP addressfrom network server when it joins a networkCan renew its lease on address in useAllows reuse of addresses (only hold address while connected
an onSupport for mobile users who want to join network (more
shortly)
DHCP overview: 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
-
7/29/2019 Network Layer.ppt
10/22
4: Network Layer 4b-10
DHCP client-server scenario
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A
B
E
DHCPserver
arriving DHCP
client needs
address in this
network
-
7/29/2019 Network Layer.ppt
11/22
4: Network Layer 4b-11
DHCP client-server scenarioDHCP server: 223.1.2.5 arriving
client
time
DHCP discover
src : 0.0.0.0, 68dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4transaction ID: 654
Lifetime: 3600 secsDHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
-
7/29/2019 Network Layer.ppt
12/22
4: Network Layer 4b-12
NAT: Network Address Translation
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
138.76.29.7
local network(e.g., home network)
10.0.0/24
rest ofInternet
Datagrams with source ordestination in this networkhave 10.0.0/24 address forsource, destination (as usual)
Alldatagrams leavinglocalnetwork have same single source
NAT IP address: 138.76.29.7,different source port numbers
-
7/29/2019 Network Layer.ppt
13/22
4: Network Layer 4b-13
NAT: Network Address Translation
Motivation: local network uses just one IP address asfar as outside word is concerned:
no need to be allocated range of addresses from ISP:- just one IP address is used for all devices
can change addresses of devices in local networkwithout notifying outside world
can change ISP without changing addresses ofdevices in local network
devices inside local net not explicitly addressable,visible by outside world (a security plus).
-
7/29/2019 Network Layer.ppt
14/22
4: Network Layer 4b-14
NAT: Network Address TranslationImplementation: NAT router must:
outgoing datagrams:replace(source IP address, port #) ofevery outgoing datagram to (NAT IP address, new port #)
. . . remote clients/servers will respond using (NAT IP address,new port #) as destination addr.
remember (in NAT translation table)every (source IP address,port #) to (NAT IP address, new port #) translation pair
incoming datagrams:replace(NAT IP address, new port #) indest fields of every incoming datagram with corresponding(source IP address, port #) stored in NAT table
-
7/29/2019 Network Layer.ppt
15/22
4: Network Layer 4b-15
NAT: Network Address Translation
10.0.0.1
10.0.0.2
10.0.0.3
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
1
10.0.0.4
138.76.29.7
1: host 10.0.0.1sends datagram to128.119.40, 80
NAT translation tableWAN side addr LAN side addr
138.76.29.7, 5001 10.0.0.1, 3345
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4
S: 138.76.29.7, 5001D: 128.119.40.186, 802
2: NAT routerchanges datagramsource addr from10.0.0.1, 3345 to138.76.29.7, 5001,
updates table
S: 128.119.40.186, 80D: 138.76.29.7, 5001 3
3: Reply arrivesdest. address:138.76.29.7, 5001
4: NAT routerchanges datagramdest addr from138.76.29.7, 5001 to 10.0.0.1, 3345
-
7/29/2019 Network Layer.ppt
16/22
4: Network Layer 4b-16
NAT: Network Address Translation
16-bit port-number field: 60,000 simultaneous connections with a single
LAN-side address!
Reserved address space (rfc 1918)NAT is controversial: routers should only process up to layer 3 violates end-to-end argument
NAT possibility must be taken into account by appdesigners, eg, P2P applications
address shortage should instead be solved byIPv6
ftp://ftp.rfc-editor.org/in-notes/rfc1918.txthttp://www.icann.org/registrars/accredited-list.htmlhttp://www.icann.org/registrars/accredited-list.htmlftp://ftp.rfc-editor.org/in-notes/rfc1918.txtftp://ftp.rfc-editor.org/in-notes/rfc1918.txt -
7/29/2019 Network Layer.ppt
17/22
4: Network Layer 4b-17
Intra-AS Routing
Also known as Interior Gateway Protocols (IGP)
Most common IGPs:
RIP: Routing Information Protocol (legacy,
RIPv2 still in use)
OSPF: Open Shortest Path First (common)
EIGRP: Enhanced Interior Gateway Routing
Protocol (proprietary Cisco Systems)
-
7/29/2019 Network Layer.ppt
18/22
4: Network Layer 4b-18
RIP ( Routing Information Protocol)
Distance vector algorithm
Included in BSD-UNIX Distribution in 1982 RFC 1058 (version 1), RFC 2453 (version 2)
Distance metric: # of hops (max = 15 hops) Can you guess why?
Distance vectors: exchanged every 30 seconds viaResponse Message (also called advertisement)
Each advertisement: routing info for maximum of 25destination nets within the AS
Uses UDP transport, port 520
-
7/29/2019 Network Layer.ppt
19/22
4: Network Layer 4b-19
Problems/limitations with RIP
Good for small systems, but doesnt scalewell
Count-to-infinity problem poisonedreverse only
Comparatively slow convergence
1979 RIP version 1
1988 IETF initiates work on replacement 1990 OSPF became new standard 1990s RIP version 2
-
7/29/2019 Network Layer.ppt
20/22
4: Network Layer 4b-20
OSPF (Open Shortest Path First)
open: publicly available Uses Link State algorithm
LS packet dissemination
Topology map at each node
Route computation using Dijkstras algorithm
However.
OSPF advertisement carries only one entry per
neighbor router Advertisements disseminated to entire AS (via
flooding)
Sent as payload in IP datagram
-
7/29/2019 Network Layer.ppt
21/22
4: Network Layer 4b-21
EIGRP (Enhanced Interior GatewayRouting Protocol)
CISCO proprietary; successor of RIP (mid 80s)
uses Distance Vector, like RIP
several cost metrics (delay, bandwidth, reliability,
load etc) uses TCP (!) to exchange routing updates
Loop-free routing via a distributed update routingalgorithm (called DUAL) based on diffused
computation
-
7/29/2019 Network Layer.ppt
22/22
4: Network Layer 4b-22
Inter-AS routing