Computer Networks, Jan-May 2004
1
Computer NetworksComputer Networks(Lecture 5: Network Layer (Lecture 5: Network Layer
Protocols )Protocols )
Arzad Kherani([email protected])
Dept. of Computer Sc. And Engg.
Indian Institute of Technology Delhi
Computer Networks, Jan-May 2004
2
OutlineOutline
Connection-less vs. connection-oriented data transfer
Routing protocol Congestion control IP protocol ICMP protocol
Computer Networks, Jan-May 2004
3
The Network LayerThe Network Layer End-to-end data transfer
– Addressing– Store-and-forward packet
switching– Routing– Congestion control– Interconnection between networks
Computer Networks, Jan-May 2004
4
Packet switchingPacket switching Store-and-forwarding at intermediate nodes using connection-
less or connection-oriented data transfer Service-provider vs. customer-premise equipment
Computer Networks, Jan-May 2004
5
Datagram RoutingDatagram Routing No connection is established Each packet is forwarded independent of others
– Every packet carries a destination address Intermediate routers maintain (and update) “routing tables”
Computer Networks, Jan-May 2004
6
Routing connectionsRouting connections A connection is established before data transfer can take place Route is fixed at the tie connection is established
– And resources allocated Connections are also known as virtual circuits
Computer Networks, Jan-May 2004
7
Datagrams vs. virtual circuitsDatagrams vs. virtual circuits
Computer Networks, Jan-May 2004
8
Routing: the problemRouting: the problem
Largely concerned with routing datagrams through a subnet Between a pair of source-destination devices, packets may
have to traverse several “subnets” Routing tables are updated every T seconds
Router2Router1LAN
H1
H2
H3 Router1
LAN
H4
H6
H5
Computer Networks, Jan-May 2004
9
Routing: the problem (2)Routing: the problem (2)
Correct Simple Robust
– Address the problems of changing traffic conditions, changes to topology, failures (both transient and permanent)
Stable– In several cases route computation is an iterative process– In such cases the process must converge– Incremental changes in traffic/topology must result in increment
changes in routes (I.e. there are no large swings in routes due to increnetal changes)
Fair Optimal
Computer Networks, Jan-May 2004
10
Routing: the problem (3)Routing: the problem (3)
Fairness vs. Optimality
Computer Networks, Jan-May 2004
11
Routing: the problem (4)Routing: the problem (4)
Performance metrics:– Transit delay– Throughput– Number of hops– Security
Delay vs. throughput
Computer Networks, Jan-May 2004
12
Routing protocols: classificationRouting protocols: classification Static routes
– Computed off-line– based on certain topology, traffic,
performance metric– Not change, unless there is a
major network overhaul Adaptive routing
– Routes adapt to changes in topology, traffic
– On-line based on current measurements
– Based on complete or partial knowledge
– Distributed computation vs. centralized computation
Other algorithms– Flooding– Ho-potato
static adaptive
Centralized (based on all info)
Decentralized (on incomplete info)
Routing algorithms
others
Computer Networks, Jan-May 2004
13
FloodingFlooding
An incoming packet is sent on all incoming links Limit the number of hops to avoid infinite loops
– Or, forward packets only once using a packet ID Or only on selected links (in the right direction)
Useful in case some data is to be “broadcasted” Terribly expensive in terms of resource utilization But, results in minimum delay
Computer Networks, Jan-May 2004
14
Static routing Static routing
Shortest path routing using Dijkstra algorithm– Where “distance” is either delay, drop rate, or simply number of
hops Results in “rooted” tree with destination as the root
Computer Networks, Jan-May 2004
15
Static routing: Dijkstra algorithmStatic routing: Dijkstra algorithm
Computer Networks, Jan-May 2004
16
Adaptive routingAdaptive routing
Distance-vector routing Link-state routing Others
– Hierarchical routing Standards
– OSPF– BGP– MPLS and “traffic engineering”
Computer Networks, Jan-May 2004
17
Distance-vector routingDistance-vector routing
Also known as Bellman-Ford routing– Used in Arpanet, till 1979
Each router maintains a routing table, with estimated “distance” to each destination (and updates it periodically)
Each router periodically exchanges this table with its neighbors
At node J
Computer Networks, Jan-May 2004
18
Distance-vector routingDistance-vector routing
Each router measures “distance” on each outgoing link– Using e.g. queue length, round-trip delay
It re-computes the routes as follows:
At node J
Computer Networks, Jan-May 2004
19
Distance-vector routingDistance-vector routing
Several problems with Distance Vector routing:– Poor estimate of delays along each link– Count-to-infinity problem:
Good news spreads fast Bad news travels slow, very slow
Computer Networks, Jan-May 2004
20
Link State RoutingLink State Routing Every few seconds (or minutes), each router:
– Re-discovers the neighborhood (and their addresses)– Estimate delays (or distances) to each of its neighbors– Construct a packet with above information– Send it to all routers in the network – Collate similar information from all routers in the network– Re-compute the “shortest” routes
Possibly using Dijkstra’s algorithm
Computer Networks, Jan-May 2004
21
Two fundamental pointsTwo fundamental points
Routing schemes discussed thus far– Belong to “ routes for all source-destination pairs”
As opposed to “on-demand routing”, where a route is determined only if and when needed (as in wire-less networks, MPLS networks)
– Belong to schemes where “routing tables” are used to route packets
As opposed to “source-routing”, where each packet carries the route that it must follow
Computer Networks, Jan-May 2004
22
Link State Routing:Link State Routing: Neighborhood discoveryNeighborhood discovery
Use “hello” packets on each outgoing links– Neighbors respond with an “ack”
Computer Networks, Jan-May 2004
23
Link State Routing:Link State Routing: Measuring Distances over LinksMeasuring Distances over Links
Use hello packets, and timers, to estimate delay– Start timer when the “hello” packet is put in the queue
Takes into account “load”
– Or, when its transmission is started Does not take into account “load”
Computer Networks, Jan-May 2004
24
Link State RoutingLink State Routing Format of the link-state packet:
– “seq no” helps with flooding the packet to all routers– Age, so that the information can be discarded after a while
Computer Networks, Jan-May 2004
25
Link State RoutingLink State Routing Packet processing:
– Re-sequencing of link-state info packets Ignore packets with “lower” sequence numbers (as “stale”)
– What if a packet is lost? No big deal
– Other problems What if a sequence number is corrupted by noise? And this fact goes
undetected What if a router re-boots?
– Each packet has an associated “age” in seconds (say 60 sec) “age” is decremented every second by intermediate routers, and by
the router that caches it processing starts afresh if age 0
Computer Networks, Jan-May 2004
26
Link State RoutingLink State Routing Route computation:
– Note every router has identical information– Use Dijkstra’s shortest path algorithm
Problems:– Stale information– Incorrect information– Incomplete information– Inconsistent routes loops
Computer Networks, Jan-May 2004
27
Link State RoutingLink State Routing Standards
– IS-IS Used with variety of protocols, including IP, IPX
– OSPF An Internet RFC
Computer Networks, Jan-May 2004
28
Hierarchical RoutingHierarchical Routing
Essentially solves “scalability” problem for large networks Considers a network to consist of a connected network of regional
networks Routing is either within the local region, or across regions Multiple levels of hierarchy ( 2 or more)
Computer Networks, Jan-May 2004
29
Hierarchical RoutingHierarchical Routing
Significant saving in size of routing tables– In example below, entries in table at 1A:
for local destination: 3 (size of local network) For other regions: 4 (one for every other region)
– For a network with say 720 routers organized as 8 regional networks, each consisting of 9 sub-nets, each of which contains 10 routers:
10 entries, one for each router in its sub-net 8 entries, one for every other sub-net 7 entries, one for every other regional network
Computer Networks, Jan-May 2004
30
Broadcast routing: multi-destination routingBroadcast routing: multi-destination routing
Send n-1 copies, one for every other router Multi-destination routing (a smarter of sending one copy to every other
router)– The source sends a packet, containing list of all n-1 destinations addresses– When a packet arrives at an intermediate router, the router identifies for
each destination the “best” route, and then sends a packet on an outgoing line with the packet containing a list of sub-set of destination addresses
– Both distance-vector and link-state routing algorithms will provide the necessary information
source
Computer Networks, Jan-May 2004
31
Broadcast routing: spanning-tree basedBroadcast routing: spanning-tree based
Intelligent form of broadcast, based on a spanning tree rooted-at-source
– The problem with this router is: does each router know the spanning tree– Works with link-state routing, but not distance-vector routing
source
Computer Networks, Jan-May 2004
32
Broadcast routing: reverse path forwardingBroadcast routing: reverse path forwarding
Essentially spanning tree based packet broadcast, except that the spanning tree is determined on-the-fly
Simple, efficient
Computer Networks, Jan-May 2004
33
Multicast routingMulticast routing
Spanning tree vs. multicast tree– The latter includes nodes that are required to forward packets to all member nodes
Multi-destination routing to all K-1members– When a packet arrives at an intermediate router, the router identifies for each destination the “best”
route, and then sends a packet on an outgoing line with the packet containing a list of sub-set of destination addresses
– Both distance-vector and link-state routing algorithms will provide the necessary information
Computer Networks, Jan-May 2004
34
Routing in peer-to-peer ad hoc networksRouting in peer-to-peer ad hoc networks
What is different about routing in ad hoc networks– Routing environment
Wireless, mobile hosts resulting in:– Greater probability of link, node failure
– Changing topology
– Frequent route changes Every device is a potential router
Potentially different goals:– Stability of routes– Power consumption
Computer Networks, Jan-May 2004
35
Classification of routing protocolsClassification of routing protocols
Multicast routing Unicast routing
– Proactive protocols Where routes between every pair of nodes are computed a-priori Examples: distance-vector, link-state rouitng in IP networks Advantage: reduced latency Dis-advantage: excessive overhead due to route computation
– Reactive protocols Routes are determined between a pair of devices only when required As in MPLS networks Advantage: overhead is minimized Dis-advantage: Increased latency
– Example routing protocols for ad hoc networks Flooding Dynamic source routing AODV …
Computer Networks, Jan-May 2004
36
Dynamic Source Routing (DSR)Dynamic Source Routing (DSR)
If source S does not have a route to destination D:– It initiates “route discovery”– Or, broadcasts (floods) Route Request (RREQ)– RREQ includes address S as “source address”
B
A
S EF
H
J
D
C
G
IK
M
N
L
[S]
Computer Networks, Jan-May 2004
37
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
Each node appends own identifier when forwarding RREQ Issues concerning hidden terminal and of collisions again arise
B
A
S E
F
H
J
D
C
G
IK
M
N
L
[S,E]
[S,C]
[S,B]
Computer Networks, Jan-May 2004
38
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
DSR effectively uses flooding to discover a route to destination
B
A
S E
F
H
J
D
C
G
IK
M
N
L
[S,C,G]
[S,E,F]
Computer Networks, Jan-May 2004
39
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
Route discovery continues till node M has also attempted to find a route to destination D
Final route is say [S, E, F, J, D]
B
A
S E
F
H
J
D
C
G
IK
M
N
L
[S,C,G,K]
[S,E,F,J]
Computer Networks, Jan-May 2004
40
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
Destination sends a RREP (Route Reply) back to source S, together with route [S, E, F, J, D]
RREP is sent along route obtained by reversing discovered route, viz. [D, J,F, E, S]
B
A
S EF
H
J
D
C
G
IK
M
N
L
RREP [S,E,F,J,D]
Computer Networks, Jan-May 2004
41
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
For DSR to succeed, links must be bi-directional:– RREP is sent along route obtained by reversing discovered route– Ensure:
Intermediate node forwards RREQ if it is received on a bi-directional link
Intermediate node forwards RREQ on links that are known to be bi-directional
– If links (in general) are not bi-directional then RREP is sent on a (new) discovered route from D to S RREP is piggybacked onto RREQ packets for D to S
Links are bi-directional in IEEE 802.11 and in Bluetooth
Computer Networks, Jan-May 2004
42
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
Processing of RREP:– Source S caches the discovered route for subsequent packets– The route is included in each packet as “source route”
B
A
S EF
H
J
D
C
G
IK
M
N
L
DATA [S,E,F,J,D]
Computer Networks, Jan-May 2004
43
Dynamic Source Routing (contd.)Dynamic Source Routing (contd.)
– Intermediate nodes also cache relevant portions of the route for their use
B
A
S EF
H
J
D
C
G
IK
M
N
L
DATA [E,F,J,D]
Computer Networks, Jan-May 2004
44
Route Caching in DSRRoute Caching in DSR
All nodes along the discovered route deduce and cache a route by any means:
– Given fact that RREP contains route [S, E, F, J, D]: S has a route to E, F, J as well E has a route [E, F, J, D] to D So does E to F and to J, and F to J
– Given fact that intermediate nodes need to forward RREP Nodes D, J, F, E all have a route to S, and to intermediate nodes Etc.
S EF
J
DRREP [S,E,F,J,D]
Computer Networks, Jan-May 2004
45
Route Caching in DSR (contd.)Route Caching in DSR (contd.)
Other nodes not on the discovered path also discover routes:– For example, when node K receives RREQ [S,C,G] for node D, node K
learns route [K,G,C,S] to node S
B
A
S E
F
H
J
D
C
G
IK
M
N
L
[S,C,G]
[S,E,F]
Computer Networks, Jan-May 2004
46
Route Caching in DSR (contd.)Route Caching in DSR (contd.)
Cached routes are used:– To route packets– To obtain alternate routes when a route in use is broken
speed up recovery
– To respond to RREQ if a route is cached speed up route discovery limit propagation of RREQ
Computer Networks, Jan-May 2004
47
Route Recovery in DSRRoute Recovery in DSR
Speed up recovery:– If node E fails
S initiates route discovery Node C responds immediately with RREP [S,C,G,K,D] S routes data with source route [S,C,G,K,D]
B
A
S EF
H
J
D
C
G
IK
M
N
L
route [S,E,F,J,D]
route [C, G, K, D]
Computer Networks, Jan-May 2004
48
Route Recovery in DSR (contd.)Route Recovery in DSR (contd.)
Link failure is detected when node is unable to forward source-routed packet – notification is sent up-stream
Source S and intermediate nodes remove all routes with broken link as one of the links
B
A
S EF
H
J
D
C
G
IK
M
N
L
RERR [J-D]
Computer Networks, Jan-May 2004
49
Route Caching in DSR (contd.)Route Caching in DSR (contd.)
Cached routes may become invalid due to changes in topology (or mobility)– Stale, invalid cache pollute neighboring caches– Impact on performance
No route is available Route is poor
Need to implement policy to “purge” stale/invalid cache entries
Computer Networks, Jan-May 2004
50
DSR: pros and consDSR: pros and cons
Pros:– On demand routing– Caching speeds up route discovery– Route discovery uses flooding discovers minimum delay routes– Routing tables are not maintained
Cons:– Requires entire route to be included in packet header– Requires symmetric links– Inherits all problems associated with flooding (too many RREQs,
collisions, hidden terminals)– Stale, invalid cache
Computer Networks, Jan-May 2004
51
Congestion, and its controlCongestion, and its control
Congestion == when a network is unable to move packets because there are too many packets in the network
It occurs because of:– Slow links– Slow routers/switches– Burst of packets are injected into the network– Small number of buffers
Congestion feeds upon itself Congestion can spread
Computer Networks, Jan-May 2004
52
Congestion, and its controlCongestion, and its control
Difference between “flow control” and “congestion control”– Congestion has to do with networks carrying capacity
Flow control has to do with a destination node having to receive and process incoming packets
– Congestion is a global issue Flow control is an issue pertaining to communication between a pair of devices
Yet, methods used for flow control and congestion control CAN be similar
Computer Networks, Jan-May 2004
53
Congestion controlCongestion control
Open loop control– Good design
Accept new traffic carefully Discard traffic Schedule packet transmission Allocate buffers
– Attempted in all protocol layers Closed loop control
– Closely monitor congestion Queue lengths packets dropped due to unavailability of buffers Link utilization Transit delay, and jitter
– Exchange information with other nodes (particularly those responsible for taking actions)
adds to congestion
– Adjust network operation (re-schedule, re-route, drop packets, block traffic, …)
Computer Networks, Jan-May 2004
54
Congestion controlCongestion control
Computer Networks, Jan-May 2004
55
Congestion control in virtual-circuit based networksCongestion control in virtual-circuit based networks
Admission control– Works only with virtual circuits-based networks– A new connection is accepted only if adequate resources are available to
support it– Different routes may be used to circumvent congestion– Comes with its own issues with reservations
Under-utilization When required, excess capacity is unavailable
Computer Networks, Jan-May 2004
56
Congestion control in datagram-based networksCongestion control in datagram-based networks
Each node is responsible for monitoring, communicating status, and controlling it
Monitor congestion by measuring:– Queue length, channel utilization, delays, etc.– Usually work with averages
Averaging interval? Averaging process? E.g.
Signaling congestion to source– Implicitly:
Set a “congestion bit” in packet sent to destination, which in turn sets the bit in an ACK
Simply drop the packet, and let source discover that fact, as with– Drop-tail– RED
– Explicitly: Send a “choke” packet to source
Computer Networks, Jan-May 2004
57
Random Early Detection (RED) algorithm-based Random Early Detection (RED) algorithm-based congestion avoidancecongestion avoidance
RED algorithm– Developed by Sally Floyd and Van Jacobson, 1993– Used extensively in Internet
Design goals:– Avoid congestion, rather than remove congestion early detect
Do so by ensuring that the queue does not overflow– Also ensures that the queuing delay is small
– Avoid global and synchronous pull-back of traffic Thus ensures that throughput remains high
– Not be biased against bursty traffic Basic idea
– Act upon when average queue length begins to grow– Randomly “mark” a packet, in the hope that TCP connection will slow down
In the present context “mark” == ”drop”
Computer Networks, Jan-May 2004
58
Random Early Detection (RED) algorithmRandom Early Detection (RED) algorithm
Computer Networks, Jan-May 2004
59
Random Early Detection (RED) algorithmRandom Early Detection (RED) algorithm
Computer Networks, Jan-May 2004
60
Random Early Detection (RED) algorithmRandom Early Detection (RED) algorithm
Computation of average queue length
Computer Networks, Jan-May 2004
61
RED algorithmRED algorithm
Packets dropped
Computer Networks, Jan-May 2004
62
Quality of Service (QoS)Quality of Service (QoS)
Low delay/jitter == not sensitive to delay/jitter
Two ways to characterize Q0S requirements of end applications– As was done in ATM networks:
Constant bit rate, CBR (e.g. telephony) Variable bit-rate, VBR (e.g. video conferencing) Available bit rate, ABR (e.g. file transfer)
– Based on performance parameters: reliability, delay, jitter etc.
Computer Networks, Jan-May 2004
63
QoSQoS
Techniques:– Over-provision of resources
Comes with its own limitation (hogging, …)
– Buffering Basically counters the effect of large jitter
– Traffic shaping Comes with traffic policing, marking (or dropping)
Computer Networks, Jan-May 2004
64
QoS: traffic shapingQoS: traffic shaping
Leaky bucket– Useful when a host generate bursty traffic, but at a higher rate
MUX
H_1
H_n
H_2
…
25MBps link
2 MBps link
Computer Networks, Jan-May 2004
65
QoS: traffic shaping using “leaky bucket”QoS: traffic shaping using “leaky bucket”
A leaky bucket is essential a finite buffer
But does not permit host to accumulate “credits”
1 MB buffer
Computer Networks, Jan-May 2004
66
QoS: traffic shaping using “token bucket”QoS: traffic shaping using “token bucket”
Token Bucket scheme for traffic shaping permits host to accumulate “credits”
– Tokens are generated at a fixed rate, and saved in a bucket– One packet may be sent for every available token in bucket– If the “token bucket” overflows, token are lost– The packet buffer may be very large, independent of size of token bucket
packets are not discarded when large burst arrives
Computer Networks, Jan-May 2004
67
QoS: traffic shaping using “token bucket”QoS: traffic shaping using “token bucket”
Assume:rate tokens are generated: /secbucket size: C bytesmaximum output rate: M Bpslength of burst: S sec.
Then:C + S = M S
OrS = C/ (M- ), burst size in Bytes is MS
500 KB token bucket
250 KB token bucket
Burst= 1 MB
Computer Networks, Jan-May 2004
68
QoS: traffic shaping using “token bucket”QoS: traffic shaping using “token bucket”
The output rate need not be the same as that at which the host produces data use a leaky bucket following the token buffer
– I.e. just put a buffer for data packets, and pull packets at the rate dictated by availability of token, but at the reduced TX rate
500 KB token bucket
250 KB token bucket
750 KB token bucket
Burst= 1 MB
Computer Networks, Jan-May 2004
69
Resource ReservationResource Reservation
Resources need to be reserved in order to guarantee committed QoS– Bandwidth
Easy enough to determine Need to keep some spare bandwidth to handle bursts and “best-effort” traffic
– Buffer space somewhat difficult, unless “burst length” is specified else estimate using avg_q_length = /(-), where and are respectively
arrival and service rates – Service rate is determined by available bandwidth & CPU capacity
– CPU cycles Even more difficult Router characterized by routing capacity, X packets/sec Need to specify required processing capacity in terms of Y packets/sec
– May be calculated using peak & avg data rate, burst size, min and max packet size
Computer Networks, Jan-May 2004
70
Admission controlAdmission control
If resources are to be reserved, each “flow” needs to be “admitted” using an “admission control” scheme
– QoS requirements for each flow is a must (e.g.
– Control based on available resources, viz.-a-viz. resources required by a flow or the aggregate of flows
– Yet there must be spare capacity
Computer Networks, Jan-May 2004
71
RoutingRouting
Ensure that each “flow” or an “aggregate” is routed suitably, so that QoS constraints can be met
MPLS is one way to route
Computer Networks, Jan-May 2004
72
Has been around for decades Uses “maximal prefix match” to route packets
– Slows down routing Routing is based on destination IP address
– But, one may prefer routes based on QoS, security, etc.
Routing (using MPLS)Routing (using MPLS)
Computer Networks, Jan-May 2004
73
Provides for a tunnel for each “equivalence class” through a public network– Provide secure communication– Provide QoS guarantees (throughput, delay, drop rates, …)
128.1.47.1
128.1.47.2128.1.47.3
Ingress router
IP network
IP network
Egress router
IP network
IP networkMPLS network
MPLSMPLS
Computer Networks, Jan-May 2004
74
TunnelsTunnels
Computer Networks, Jan-May 2004
75
128.1.47.1
128.1.47.3
123
12
1
2
3
3
IP I/F DestAddr MPLS I/F Label In
… … … …
1 128.1.47.1 3 99
… … … …
IP I/F DestAddr MPLS I/F LabelOut
… … … …
3 128.1.47.1 1 50
… … … …
MPLS I/F Label In MPLS I/F LabelOut
… … … …
3 50 1 99
… … … …
MPLSMPLS
Computer Networks, Jan-May 2004
76
Each LSP is routed independent of others– Uses “traffic engineering” to identify routes– Protection from node/link failure is on a per-LSP basis
Uses faster label swapping in place of routing Provides for a stack of labels, to allow tunnels to be built within tunnels
IP routing
Ingress router
Egress router
LSP
IP routing
MPLSMPLS
Computer Networks, Jan-May 2004
77
Packet SchedulingPacket Scheduling
Queuing– Hogging, no way to ensure QoS
Fair queuing– Everyone gets the same share
Weighted fair queuing– Fair queuing with priority
Computer Networks, Jan-May 2004
78
Differentiated servicesDifferentiated services
A simpler approach– No initial set up– No per-flow information– Defines several “types of services”
Expedited forwarding Assured forwarding Etc.
Classification of packets, based on– SRC, DST addresses and port nos.– “type of service” byte in IP packet header (actually 6 bits)
Once classified, traffic may still be subject to policing, marking Once classified, packets are treated differently
Computer Networks, Jan-May 2004
79
Differentiated servicesDifferentiated services
Expedited forwarding– May be implemented using two separate queues, with say 20%
bandwidth reserved for expedired traffic
Computer Networks, Jan-May 2004
80
Differentiated servicesDifferentiated services
Assured forwarding– Different levels of priority– Different drop probability for each “class”
Computer Networks, Jan-May 2004
81
Interconnected NetworksInterconnected Networks
Internet is the prime example Enterprise networks, that connect into the Internet
Computer Networks, Jan-May 2004
82
Interconnected NetworksInterconnected Networks
Interconnected networks differ from each other several different ways:
Computer Networks, Jan-May 2004
83
IP ProtocolIP Protocol
Internet Protocol (IP) is the glue– It facilitates packets to be transported across different types of
networks, from source host to destination host
Computer Networks, Jan-May 2004
84
IP addressingIP addressing
32 bit IP address == network address + host address– This is so in IPv4
Different classes of of networks– Classes A, B, C
Computer Networks, Jan-May 2004
85
IP addressingIP addressing
Several IP addresses are reserved, and have specific meaning, pre-assigned to them
Computer Networks, Jan-May 2004
86
IP addressingIP addressing
Subnets split a network into subnets for two different departments/labs, or 10.20.3.0 and 10.20.4.0
– or
Computer Networks, Jan-May 2004
87
IP addressingIP addressing
The notion of “Mask”
Consider IP address 194.24.17.4 in Oxford:
it is AND-ed with mask of Cambridge, Edinburgh and of Oxford it matches only with Oxford base address. Longer matches are also tried.
Mask for Cambridge = 255.255.248.0
Mask for Oxford = 255.255.240.0
Mask for Edinburgh = 255.255.252.0
11100 0010 0001 1000 0001 0000 0000 0000,
Or 194.24.16.0
Computer Networks, Jan-May 2004
88
IP packet formatIP packet format
version of the IP protocol
IP header length in 32 bit words
used for DiffServ length of header + payload
Unique packet id “do not fragment” “more fragments”Specified in terms of “no of 8 bytes”
Computer Networks, Jan-May 2004
89
IP packet fragmentationIP packet fragmentation
Basic principle
Computer Networks, Jan-May 2004
90
IP packet formatIP packet format
Helps to limit the no. of hops or time spent in the
network
Protocol used to generate the payload (TCP, UDP etc.)
16 bit checksum, covers header only
Source IP address Destination IP addressOptional information, such as source route
Computer Networks, Jan-May 2004
91
Internet control protocolsInternet control protocols
Several protocols:– ARP, RARP (these are discussed later)– ICMP
Several messages, including “echo” and “echo-reply” used to “ping” hosts
These are encapsulated inside an IP packet
Computer Networks, Jan-May 2004
92
ARP protocolARP protocol
ARP protocol: “address resolution protocol”– IP address Data-link (or physical) address– This is distinct from”domain-name” IP address problem
Computer Networks, Jan-May 2004
93
ARP protocolARP protocol
ARP protocol:– ARP-REQ ARP-REPLY packets
ARP-REQ is broadcast over local subnet only
– Destination IP address Ethernet address is cached by source, once a reply is received
– The destination also caches similar info about the source
Computer Networks, Jan-May 2004
94
ARP protocolARP protocol
Consider H1 to H4 communication– H1 issues an ARP-REQ, to which CS router responds with its E3
address– CS router issues an ARP-REQ on FDDI ring, to which EE router
responds with its F3 address– EE router issues an ARP-REQ on the Ethernet, to which H4
responds with its E6 address
Computer Networks, Jan-May 2004
95
ARP protocol: packet formatARP protocol: packet format
Computer Networks, Jan-May 2004
96
RARP protocolRARP protocol
ARP gives IP-addr Physical-addr RARP solves the problem of “what is my IP address”?
– A problem that occurs in disk-less workstations, that have no disk resident OS
RARP-REQ issued by client, while RARP-REPLY is sent by RARP server
Need a RARP server for each network separated by a router Need to have entries for each IP-addr IP address Both problems solved using DHCP protocol
Computer Networks, Jan-May 2004
97
??
?
Computer Networks, Jan-May 2004
98
??
?
Computer Networks, Jan-May 2004
99
??
?
Computer Networks, Jan-May 2004
100
??
?
Computer Networks, Jan-May 2004
101
ThanksThanks