© oxford university press 2011 computer networks bhushan trivedi, director, mca programme, at the...
TRANSCRIPT
© Oxford University Press 2011
Computer NetworksComputer Networks
Bhushan Trivedi, Director, MCA Programme, at the GLS Institute of
Computer Technology, Ahmadabad
© Oxford University Press 2011
Chapter 7Chapter 7
The Network LayerThe Network Layer
© Oxford University Press 2011
Routing and Forwarding
• Routing is – to know about other routers – where each of them is located– which networks they are connected to
• Forwarding is – finding out about one’s own neighbouring routers – forward a specified packet to its nearest
neighbour to make it reach to a given destination
© Oxford University Press 2011
Routing and forwarding
• Routing table contains information about nearest router for given destination
• Routing algorithms decide placement of routers
• Virtual circuit is mechanism used for connection oriented forwarding
• Datagrams are units of data sent in connectionless forwarding
© Oxford University Press 2011
Network layer duties
• Handling accounting for usage of network resources
• Devise and implement mechanisms of identifying each machine uniquely
• Implement connectionless or connection-oriented forwarding
• Multiplexing and demultiplexing the transport layer and the data link layer jobs
© Oxford University Press 2011
Two different types of routing
• Collection of networks organized by a single party is known as an autonomous system (AS)
• Exterior routing is across AS– BGP (Border Gateway Protocol)
• Interior routing is within AS– Distance Vector– Link state– AODV
© Oxford University Press 2011
Other duties
• Accounting
• Receive Service from the Data Link Layer
• Provide Service to the Transport Layer
© Oxford University Press 2011
Provide Service to DLL
© Oxford University Press 2011
Provide service to transport layer
© Oxford University Press 2011
Global Machine-Level Addressing
• Classful addressing
• The dotted decimal notation
• Classless addressing
• Aggregating multiple routing entries
• Unique address requirement
• Network Address Translation
• The real solution, IPv6
© Oxford University Press 2011
Aggregating multiple route entries
© Oxford University Press 2011
Routing table without aggregation
Network ID Next hop address
Interface … (other fields)
11.1.0.0/16 R1 111.2.0.0/16 R1 111.3.0.0/16 R1 1
292.12.10.0/24 R3 2292.12.12.0/24 R3 2292.12.13.0/24
R3 2
© Oxford University Press 2011
Routing table after aggregation
Network ID
Next hop address
Interface … (other fields)
11.*/16 R1 1292.12.*/24 R3 2
© Oxford University Press 2011
Unique address requirement
© Oxford University Press 2011
Multiplexing and Demultiplexing
• Multiplexing and demultiplexing multiple transport layer connections
• Multiplexing and De-multiplexing the data link layer connections
© Oxford University Press 2011
Forwarding
• Connection-oriented forwarding using virtual Circuits
• Connectionless forwarding using datagrams
• Connection-oriented vs. Connectionless Forwarding
• forwarding examples
© Oxford University Press 2011
Steps involved in CO forwarding
• Find out a complete path to the other end
• Informs the routers along the path and gets their confirmation
• The service may be degraded or another path is tried if some router is not willing
© Oxford University Press 2011
Steps involved in CO forwardingIntermediaries are to
• (a) reserve resources
• (b) set the priorities
• (c) take a call on other services needed
• (d) reserve an amount of bandwidth
© Oxford University Press 2011
Steps involved in CO forwarding
• Connection ID is provided• Independent of other routers • No provision for a central authority
– The central authority needs to be consulted for every connection establishment process
– If the central authority fails, no connection is possile
– Assigning the connection number locally is simple and effective
• similar confirmation from the receiver is sought
© Oxford University Press 2011
Forwarding
• Virtual circuit switching
• Multi protocol Label Switching
• Flow label in IPV6
© Oxford University Press 2011
Forwarding
• Datagram based connectionless forwarding
• Comparison between Connection-oriented and Connectionless Forwarding
•
© Oxford University Press 2011
Forwarding: Datagram based connectionless
forwarding
• Not wasteful
• Autonomy and recovery
• Better fault tolerance
© Oxford University Press 2011
Normal Path when no fault
© Oxford University Press 2011
A router out of order
© Oxford University Press 2011
A communication line out of order
© Oxford University Press 2011
CO vs CL forwarding
• Connection establishment VC requires this phase, Datagram-based solutions do not
• Routing Datagrams are checked and processed at every router while not in VC
• Speed of operation more time to route datagrams
• Congestion control Admission control vs routing around the congested path
© Oxford University Press 2011
Avoiding congested path while routing
© Oxford University Press 2011
CO vs CL forwarding
• Addressing Datagrams are designed to re-route
• Robustness Datagrams are more robust when congestions are expected
• Quality of service Connection-oriented service is better to provide QOS
© Oxford University Press 2011
D is working
© Oxford University Press 2011
D is not working
© Oxford University Press 2011
B’s routing table before and after D stopped functioning
Destination Next node InterfaceA A 1K A 1I D 2
…… ….. …..
Destination Next node InterfaceA A 1K A 1I C 3
…… ….. …..
© Oxford University Press 2011
Requirements of a good Routing Algorithms
• Simple enough to be implemented
• Should not oscillate
• Fault tolerance
• Speed
• Dynamism and flexibility
• Performance
© Oxford University Press 2011
Issues in router’s performance
• A router must scale up to the size of the network attached to it
• Quality of service– Delay– delay tolerance– bandwidth, particularly for real-time
applications– Fault tolerance– High availability
© Oxford University Press 2011
Router architecture
© Oxford University Press 2011
Functions of a router: Lookup
Address prefix Next router Interface …..11* R1 1
1010* R1 110* R2 2
…
Why addresses should be truncated by prefixes
• Router should divide the addresses in as many groups as the number of interfaces available. • Easy management of the entries
© Oxford University Press 2011
Address prefixes help in routing
© Oxford University Press 2011
Issues in router’s performance
• Switching
• Queuing
• Robustness
© Oxford University Press 2011
Robustness of a routing algorithm
© Oxford University Press 2011
Routing
• Internal and External routing algorithms
• Distance Vector Routing
• Problem with count-to-infinity
• The split horizon hack
• Link State Routing
• Routing in MANet
© Oxford University Press 2011
The subnet for routing and J sender
© Oxford University Press 2011
Partial Routing table for J
Network Next router
Interface
E G 1A I 2B I 2X I 2V G 1W G 1Q C 3
….. ….. …..
© Oxford University Press 2011
Facts related to Routing
• In a large network, there may be more than one path to a given destination
• Based on the parameter considered, a path can score better than others
• When we consider a different parameter, the best path may change
© Oxford University Press 2011
Constructing routing tablesEstimated delay from I
Network Next router
Delay
A D 2B D 2K K 1O O 1X P 2U P 2V P 3
….. ….. …..
© Oxford University Press 2011
Constructing routing tablesEstimated delay from G
Network Next router
Delay
E E 1A J 4B E 4X L 4F F 1H M 2M M 1
….. ….. …..
© Oxford University Press 2011
Constructing routing tablesEstimated delay from C
Network Next router
Delay
E E 1A J 4B E 4X L 4F F 1H M 2M M 1
….. ….. …..
© Oxford University Press 2011
Constructing routing tablesAnother Example
© Oxford University Press 2011
Constructing routing tablesAnother Example
Estimated delay from B Estimated delay from DNetwor
kNext
routerDelay Networ
kNext
routerDelay
A A 3 A A 5D D 6 B B 6K A 10 K A 12H D 8 H H 2J D 12 J H 6G D 11 G G 5
© Oxford University Press 2011
Constructing routing tables
E’s Routing tableNetwork Next
routerDelay
A B 8B B 5D D 4K B 15H D 6G D 9J D 10
constructing routing table from two of the neighbor’s inputs
© Oxford University Press 2011
Count to infinity problemE’s routing table when D goes
downNetwork Next
routerDelay
A B 8B B 5D B 9K B 15H B 13G B 16J B 17
© Oxford University Press 2011
Count to Infinity ProblemAnother example
© Oxford University Press 2011
Count to infinity: C’s and B’s routing tables before D is down
Network Next router Delay A B 4B B 2D D 2
Network Next router DelayA A 2C C 2D C 4
© Oxford University Press 2011
A’s routing table and C’s modified routing table when D is down
Network Next router DelayC B 4B B 2D B 6
Network Next router Delay A B 4B B 2D B 6
© Oxford University Press 2011
How C’s routing table is further modified
Network Next router Delay A B 4B B 2D A 8
Network Next router Delay A B 4B B 2D infinity
© Oxford University Press 2011
Solution by lying: the split horizon hack
B’s routing tableNetwork Next router Delay
A A 2C C 2D C infinity
© Oxford University Press 2011
Link state routing steps
• All routers have information about their neighbours
• The router that collects the data from other routers constructs the AS topology.
• Parallel to the fist two steps, data about neighbours collected and Link state packets are generated
• They are sent to every other router
© Oxford University Press 2011
Link state algorithm
© Oxford University Press 2011
LS, step by step
• Collecting Information from other routers and estimating the AS topology
• Finding neighbours and delay
• Sequence number and Age fields
• Routing table
construction
HeaderNode Delay
E 5D 6A 3
© Oxford University Press 2011
Refinements
• All LS packets are acknowledged
• No LS packet or acknowledgement competes with normal packets.
• The sender waits for a newer packet to arrive for some time.
• No packet is forwarded to destination from where the LS packet is received, only acked
© Oxford University Press 2011
Link state packets from all neighbours
From B From A From KNode Dela
yNode Dela
yNode Dela
yE 5 B 3 A 7D 6 D 5 H 8A 3 K 7From D From G From H From J
Node Delay
Node Delay
Node Delay
Node Delay
B 6 D 5 K 8 G 3A 5 J 3 D 2 H 4H 2 J 4G 5
© Oxford University Press 2011
The graph constructed from all the packets
© Oxford University Press 2011
E’s routing table
Network Next router DelayA B 8B B 5D D 4K B 15H D 6G D 9J D 10
© Oxford University Press 2011
The issue when LAN is a part
© Oxford University Press 2011
Solution: depict LAN as a node
© Oxford University Press 2011
Routing in MANet
• No special-purpose routers
• No fixed topology
• Best path assumptions
• Power requirements
• Security issues
© Oxford University Press 2011
Route Discovery in AODV
© Oxford University Press 2011
Route Discovery in AODV
© Oxford University Press 2011
Route Discovery in AODV
© Oxford University Press 2011
Route Discovery in AODV
© Oxford University Press 2011
Route Discovery in AODV
© Oxford University Press 2011
AODV: Format of a RouteRequest packet
Source ID
Request ID
Destination
ID
Source sequence no.
Destination
sequence no.
Hop count
Time-to‑Liv
e
© Oxford University Press 2011
Route Maintenance: D’s Current routing table
Destination Next hop Distance Active neighbours
…
B B 1 G, H …E E 1 H …A A 1 G …K A 2 G, E …H H 1 A …G G 1 B …J H 2 E …
© Oxford University Press 2011
Exterior Gateway Protocol
• Border Gateway Protocol
• BGP and DV
• Path Vector Routing
• No count to infinity
• Complexity
• Impact of business relationship
© Oxford University Press 2011
The remaining AS are of second and third type.
BGP network. C and F are the first type of network, i.e. they are customers
© Oxford University Press 2011
Autonomous systems and AS
Path
© Oxford University Press 2011
Factors considered in BGP
• Local preference
• Avoiding false alarms
• Check willingness to be intermediary
• Hot potato
• Interior Routing
© Oxford University Press 2011
Hot Potato
© Oxford University Press 2011
Interior Routing
© Oxford University Press 2011
other issues
• Hierarchical routing
• Broadcast routing
• Individual delivery
• Multicast routing
• Congestion
• Congestion Control and Algorithms
• Network Layer switching
© Oxford University Press 2011
Broadcast routing
• Individual delivery
• Flooding
• Reverse path forwarding
• Spanning tree
© Oxford University Press 2011
Individual delivery
© Oxford University Press 2011
Flooding-1
© Oxford University Press 2011
Flooding-2
© Oxford University Press 2011
Flooding-3
© Oxford University Press 2011
Spanning tree
© Oxford University Press 2011
Multicast routing
• There may be multiple groups present.
• intermediaries and members
• Member belongs to multiple groups
• A sender sending to multiple groups.
• Router having information – about its downstream members– members of all the groups that pass through
it.
© Oxford University Press 2011
Congestion and control
• Bursty traffic and Traffic Jam
• Congestion control– Explicit control
• Admission control• Prevention of congested routes
– Implicit control• RED• Jitter Contro
© Oxford University Press 2011
Ignoring congested areas
© Oxford University Press 2011
The rest
• Multiprotocol Label Switching
• Internetworking issues
• Heterogeneity in network
• Fragmentation
• Tunneling
• Security issues at the Network layer and IPSec
• Overview of IPSec
© Oxford University Press 2011
Network Layer Switching
• Routing process is time consuming
• Tagging to improve
• Switching is forwarding based on tags
© Oxford University Press 2011
Advantage of labeling
• IP header does not need to change.• Simpler and faster to look up• Tags relates to required services. • independent of the network layer protocol• multiple labels pasted on a packet• Forwarding process becomes faster• Possible to monitor SLA• Layer 4 and 5 are also used to label
© Oxford University Press 2011
MPLS
© Oxford University Press 2011
MPLS and VC differences
• The labels are independent of the senders’ and receivers’ addresses
• MPLS can provide the same label to different connections
• Faster processing
• No connection establishment and termination
• No router entries in MPLS
© Oxford University Press 2011
MPLS frame format
© Oxford University Press 2011
MPLS frame format
• The MPLS header is attached above IP
• The router-router links use MPLS
• When used with Ethernet, Type is set to 8847
• The label field has local significance
• The QOS field indicates the quality of service
• TTL stands for time to live
• The S field is either 1 or 0
© Oxford University Press 2011
Heterogeneity in Networks
• Maximum transferrable unit• QOS field• Address differences• CO vs CL networks • Error, congestion and security• Fragmentation• Tunneling
– VPN– Mobile IP
© Oxford University Press 2011
The Dual Stack solution
© Oxford University Press 2011
Fragmentation
© Oxford University Press 2011
Fragmentation in Internet
© Oxford University Press 2011
Fragmentation in Internet
© Oxford University Press 2011
Fragmentation in Internet
© Oxford University Press 2011
Tunneling
© Oxford University Press 2011
Mobile IP
© Oxford University Press 2011
Mobile IP