The Network Layer
three important func ons:
pathdetermina on:route taken by packets from source to dest. Rou ng algorithms
forwarding:movepackets from routers input to appropriate router output
Copyright By PowCoder代写 加微信 powcoder
callsetup:somenetwork architectures require router call setup along path before data flows
Computer Networking and Applications
Network layer: data plane, control plane
Computer Networking and Applications
routing algorithm
routing algorithm determines end-end-path through network
forwarding table determines local forwarding at this router
local forwarding table
header output value link
0100 0101 0111 1001
value in arriving packet’s header
Service Models…
Q: What service model for the channel transpor ng packets from sender to receiver?
• guaranteed bandwidth?
• preserva on of inter-packet ming
(no ji er)?
• loss-free delivery?
• in-order delivery?
• conges on feedback to sender?
The most important abstrac on provided
by network layer:
virtual circuit or datagram?
Virtual circuits: signaling protocols
used to setup, maintain teardown VC used in ATM, frame-relay, X.25
not used in today s Internet
applica on
5. Data flow begins
4. Call connected 1. Ini ate call
6. Receive data
3. Accept call 2. incoming call
applica on
Datagram networks: the Internet model
nocallsetupatnetworklayer
routers:nostateaboutend-to-endconnec ons
no network-level concept of connec on
packetstypicallyroutedusingdes na onhostID
packets between same source-dest pair may take different paths
applica on
applica on
1. Send data
2. Receive data
Datagram or VC network: why?
Internet (DataGram)
• dataexchangeamongcomputers – elas c service, no strict
ming req.
• smart endsystems(computers)
– can adapt, perform control, error recovery
– simple inside network, complexity at edge
• manylinktypes
– different characteris cs – uniform service difficult
ATM (Virtual Circuit)
• evolvedfromtelephony • humanconversa on:
– strict ming, reliability requirements
– need for guaranteed service
• dumb endsystems – telephones
– complexity inside network
host, router network layer func ons:
IP Addressing: introduc on
IP address: 32-bit iden fier for
host, router interface
interface: connec on between
host, router and physical link
routers typically have mul ple interfaces
host may have mul ple interfaces
IP addresses associated with interface, not host, router
IP Addressing
IP address:
network part (high order bits) host part (low order bits)
What s a network ? (from IP address perspec ve)
device interfaces with same network part of IP address
can physically reach each other without intervening router
network consis ng of 3 IP networks (for IP addresses star ng with 223, first 24 bits are network address)
IP Addressing
Detach each interface from router, host
create islands of isolated networks
each isolated network is also known as a subnet
How to find the networks?
Interconnected system consis ng of six networks
IP Addresses
given no on of network , let s re-examine IP
addresses:
“class-full” addressing:
IP addressing: CIDR classful addressing:
inefficientuseofaddressspace,addressspaceexhaus on
e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network
TherearemanyclassCnetworknumbers—some2million
Allocatethem(insteadofclassBnumbers)invariablesizeblocks
eg. 2000 addresses could be allocated by 8 con guous class C networks) instead of a class B network.
CIDR: Classless InterDomain Rou ng
networkpor onofaddressofarbitrarylength
addressformat:a.b.c.d/x,wherexis#bitsinnetworkpor onofaddress
Broadcast and Mul cast
Most of the IP addresses that are used have a network sec on and a host sec on.
The larger the network sec on, the more networks that you can have.
The larger the host sec on, the more hosts you can have.
There are some special IP addresses and ranges that are used for specific
purposes in a network.
The broadcast address:
The broadcast address for any network sends the packet to EVERY node in the network.
Before CIDR, you could just set the host bits to all 1s.
The broadcast address in 10.x.x.x is 10.255.255.255
The broadcast address in 192.168.1.x is 192.168.1.255
This works neatly if you are using classes – but what about CIDR?
Broadcast in CIDR
ACIDRaddresssuchas200.23.16.0/23doesnotbreakneatlyover
a byte boundary:
Inthiscase,wes llsetthehostparttoall1s,butthismeansthat the broadcast address for network 200.23.16.0 is actually 200.23.17.255!
Networkiden fiershaveahostpartofall0s,broadcastaddresses have host part of all 1s. This means that you can t use the first or last host address in any range.
In the case above, by moving the boundary, we have more addresses than we would have in a class C, but far fewer than in a class B. We should have 512 but we lose the first (network) and the last (broadcast) – 510.
Unicast, Broadcast and Mul cast
Unicast addresses send datagrams to a single des na on.
Broadcast addresses are used to send a datagram to every other host in a given network.
Mul cast addresses are used to send datagrams to a group of interested par es.
How do you show interest?
The hosts and routers use Internet Group Management Protocol (IGMP) to communicate their desire to join the mul cast network.
The router uses the source address to determine data stream direc on
The source is considered to be upstream
The router finds all the registered downstream interfaces and sends the packets out through the interfaces, rou ng AWAY from the source.
This is also called reverse path forwarding.
IP Address Alloca on
Alloca onisbasedongeographicalzone(tosimplifyrou ng): 194.0.0.0 to 195.255.255.255 – Europe
198.0.0.0 to 199.255.255.255 – North America
200.0.0.0 to 201.255.255.255 – Central and South America 202.0.0.0 to 203.255.255.255 – Asia and Pacific
Each region has ~32 million addresses
Numbers 204.0.0.0 to 223.255.255.255 (some 320 million numbers) are s ll in reserve.
IP addresses: how to get one?
Hosts(hostpor on):
hard-codedbysystemadmininafile
DHCP:DynamicHostConfigura onProtocol:dynamicallyget address: plug-and-play
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
IP addresses: how to get one? Network(networkpor on):
getallocatedpor onofISP saddressspace:
Hierarchical addressing: route aggrega on
Hierarchical addressing allows efficient adver sement of rou ng informa on:
Organiza on 0 200.23.16.0/23
Organiza on 1 200.23.18.0/23
Organiza on 2 200.23.20.0/23
. Fly-By-Night-ISP
Send me anything with addresses beginning 200.23.16.0/20
Send me anything with addresses beginning 199.31.0.0/16
. . Organiza on 7 .
200.23.30.0/23
Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organiza on 1
Organiza on 0 200.23.16.0/23
Organiza on 2 200.23.20.0/23
. Fly-By-Night-ISP
Send me anything with addresses beginning 200.23.16.0/20
Send me anything
with addresses beginning 199.31.0.0/16 or 200.23.18.0/23
. . Organiza on 7 .
200.23.30.0/23
Organiza on 1 200.23.18.0/23
Ge ng a datagram from source to dest.
rou ng table in A
Dest. Net.
223.1.1 223.1.2
223.1.1.2 223.1.1.4
IP datagram:
next router Nhops
1 223.1.1.4 2
223.1.1.4 2
misc fields
source IP addr
dest IP addr
• datagram remains unchanged, as it travels source to des na on
• addr fields of interest here
223.1.2.1 223.1.2.9
223.1.1.3 223.1.3.1
223.1.3.27 223.1.2.2 E 223.1.3.2
misc fields
Ge ng a datagram from source to dest.
Dest. Net.
223.1.1 223.1.2
223.1.1.2 223.1.1.4
Star ng at A, given IP datagram addressed to B:
next router Nhops
1 223.1.1.4 2
223.1.1.4 2
• look up net. address of B
• findBisonsamenet.asA
• link layer will send datagram directly to B inside link-layer frame
– BandAaredirectlyconnected
223.1.2.1 223.1.2.9
223.1.1.3 223.1.3.27 223.1.2.2 E
misc fields
Ge ng a datagram from source to dest.
Star ng at A, dest. E:
• lookupnetworkaddressofE
• Eondifferentnetwork
– A,Enotdirectlya ached
• rou ngtable:nexthoproutertoEis
• linklayersendsdatagramtorouter
next router Nhops
1 223.1.1.4 2
223.1.1.4 2
Dest. Net.
223.1.1 223.1.2
223.1.1.2 223.1.1.4
223.1.2.1 223.1.2.9
223.1.1.4 inside link-layer frame B
• datagram arrives at 223.1.1.4
• con nued…..
223.1.1.3 223.1.3.1
223.1.3.27
223.1.2.2 E 223.1.3.2
misc fields
Ge ng a datagram from source to dest.
Dest. next
network router Nhops interface
Arriving at 223.1.4, des ned for 223.1.2.2
• look up network address of E
• E on same network as router’s interface
– router,Edirectlya ached
• link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9
• datagram arrives at 223.1.2.2!!! (hooray!)
223.1.1 – 223.1.2 –
1 223.1.1.4 1 223.1.2.9
1 223.1.3.27
223.1.1.3 223.1.3.27 223.1.2.2 E
223.1.2.1 223.1.1.4 223.1.2.9
IP Fragmenta on & Reassembly
network links have MTU (max.transfer size) – largest possible link-level frame.
different link types, different MTUs
large IP datagram divided ( fragmented ) within net
one datagram becomes several datagrams
reassembled only at final des na on
IP header bits used to iden fy, order related fragments
fragmenta on:
in: one large datagram out: 3 smaller datagrams
reassembly
IP was designed in the 1970’s to support researchers and the military. The global use today wasn’t predicted.
Early design decisions led to predic ons in the early 1990’s of the “death of the Internet” due to
Shortage of Internet protocol (IP) addresses Rou ng table explosion
Shortage of network numbers
New capabili es needed:
Improved security (or even some security!) Support for QoS (real- me services)
Be er mul cas ng support
Mobile compu ng
• Early proposals
– CLNP (Connec onless Network
– SIP (Simple IP)
– Pip(Paul’s Internet protocol)
– SIPP (SIP plus Pip) became IPv6 or IPng
Two paths could be taken
Retrofit larger addresses and func onality onto IPv4 Develop a new version of IP
Expanding the address space
By 1996, all of the class A networks, 62% of class B and 37% of class C networks were allocated. Predicted to run out of addresses in 2008.
The temporary solu on is Classless InterDomain Rou ng (CIDR)
With the push towards IP enabled devices this is likely to be only a temporary
patch. IPv6 aims for a more permanent solu on.
How big is “big enough” for the address space?
Current 32 bit space allows billions of addresses.
Inefficiencies of alloca on are almost inevitable.
May want to iden fy experimental networks in a different address spaces. Can we predict future use? Are we se ng ourselves up to need IPv7?
Should the address be variable length?
IPv6 addressing
128 bits was a compromise
Fixed addresses are easier to manage and program.
There is nearly 1 IP address for every molecule on the earth’s surface.
Even with inefficient alloca on there should be at least 1000 addresses per square
128 bit addresses are wri en in hex:x:x:x:x:x:x:x:x
Each x is 16-bits = 4 hex digits
Leading zeros are not required
Sequence of zero fields given by “::”
1080:0:0:0:8:800:200C:417A = 1080::8:800:200C:417A FF01:0:0:0:0:0:0:43 = FF01::43 0:0:0:0:0:0:0:1 = ::1
IPv6 Rou ng
Each interface has an address (but possibly more than one):
Unicast – iden fy single interface
Anycast (or “cluster”)– iden fy one out of number of interfaces ie. any one will do (eg. nearest host)
Mul cast – iden fy set of interfaces, all of which are to receive message
Inten on in IPv6 addresses is to support hierarchical rou ng
→ prefixes will iden fy registries, providers etc.
Example: hierarchical organisa on: s n m
subscriber prefix area id subnet id
This will help rou ng tables
Other possibili es:
global provider-based unicast address geographic-based unicast address
128-s-n-m interface id
IPv6 Header
IPv6 8 fields in base header vs 13 fields in IPv4 Faster processing
Simpler management
More flexibility
type of service
16-bit iden fier
fragment offset
me to live
upper layer
32 bit source IP address
32 bit des na on IP address
Op ons (if any)
Internet checksum
Extension Headers
This base header is followed by a number of op onal extension headers
S ll allows flexibility
Each header specifies code of
next header/data component
Extension headers commonly specify:
type of header and length
response if the router can’t process the header — ignore the header, skip the packet, skip the packet and report an error
Extension Header
Descrip on
Hop-by-hop Op ons
Misc. informa on for routers
Full, or par al, route to follow
Fragmenta on
Management of datagram fragments
Authorisa on
Verifica on of Sender s Iden ty
Encrypted Security Payload
Informa on about encrypted Contents
Des na on Op ons
Addi onal Info for des na on
Fragmenta on
Fragmenta oninforma onisnolongerineveryheader,butonlyin special extension headers
Fragmenta onisnolongerperformedatintermediaterouters
The source host should choose datagram size so fragmenta on
is not necessary
Source host needs to run “path MTU discovery”
e.g. send sequence of datagram sizes to target un l they don’t arrive
Transi on From IPv4 To IPv6
Notallrouterscanbeupgradedsimultaneously no flag days
How will the network operate with mixed IPv4 and IPv6 routers? Twoproposedapproaches:
Dual Stack: some routers with dual stack (v6, v4) can translate between formats
Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers
Changesinnetworkingtechnologiesalwaysproceedbyevolu on, rather than revolu on
Dual Stack Approach
IPv6 inside IPv4 where needed
Tunneling is a generically useful technique in networking…
Note that IPv6 payloads could be anything! We could tunnel arbitrary protocols
This is how experimenta on is done –
New protocols are tunneled across exis ng
infrastructure
Can spread new protocols across the network this way
Can link in new devices or old devices this way
Can implement secure networks this way (see later…)
IPv6 Summary What has changed
Simpler, fixed length header No fragmenta on in routers
Op ons in extension headers No checksum
128 bit (IPv4 32 bit) addresses, with hierarchy Addi onal support for
Mul cast and anycast rou ng
Mobile hosts and autoconfigura on Real Time applica ons
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com