Download Ad hoc Networks

Document related concepts

Computer security wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Airborne Networking wikipedia , lookup

Computer network wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Deep packet inspection wikipedia , lookup

IEEE 1355 wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Peering wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Quality of service wikipedia , lookup

Routing wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Transcript
Computer Networks
(Lecture 5: Network Layer
Protocols )
Arzad Kherani
([email protected])
Dept. of Computer Sc. And Engg.
Indian Institute of Technology Delhi
Computer Networks, Jan-May 2004
1
Outline





Connection-less vs. connection-oriented data
transfer
Routing protocol
Congestion control
IP protocol
ICMP protocol
Computer Networks, Jan-May 2004
2
The Network Layer

End-to-end data transfer
– Addressing
– Store-and-forward
packet switching
– Routing
– Congestion control
– Interconnection
between networks
Computer Networks, Jan-May 2004
3
Packet switching


Store-and-forwarding at intermediate nodes using connectionless or connection-oriented data transfer
Service-provider vs. customer-premise equipment
Computer Networks, Jan-May 2004
4
Datagram 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
5
Routing 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
6
Datagrams vs. virtual circuits
Computer Networks, Jan-May 2004
7
Routing: 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
H1
H4
H5
H2
LAN
Router1
Router2
H3
LAN
H6
Router1
Computer Networks, Jan-May 2004
8
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
9
Routing: the problem (3)

Fairness vs. Optimality
Computer Networks, Jan-May 2004
10
Routing: the problem (4)

Performance metrics:
– Transit delay
– Throughput
– Number of hops
– Security

Delay vs. throughput
Computer Networks, Jan-May 2004
11
Routing 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

Routing
algorithms
static
adaptive
Centralized (based
on all info)
others
Decentralized (on
incomplete info)
Other algorithms
–
–
Flooding
Ho-potato
Computer Networks, Jan-May 2004
12
Flooding


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
13
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
14
Static routing: Dijkstra algorithm
Computer Networks, Jan-May 2004
15
Adaptive routing



Distance-vector routing
Link-state routing
Others
– Hierarchical routing

Standards
– OSPF
– BGP
– MPLS and “traffic engineering”
Computer Networks, Jan-May 2004
16
Distance-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
17
Distance-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
18
Distance-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
19
Link 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
20
Two 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
21
Link State Routing:
Neighborhood discovery

Use “hello” packets on each outgoing links
– Neighbors respond with an “ack”
Computer Networks, Jan-May 2004
22
Link State Routing:
Measuring 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
23
Link 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
24
Link 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
25
Link 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
26
Link State Routing

Standards
– IS-IS
 Used with variety of protocols, including IP, IPX
– OSPF
 An Internet RFC
Computer Networks, Jan-May 2004
27
Hierarchical 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
28
Hierarchical 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
29
Broadcast 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
30
Broadcast routing: spanning-tree based

Intelligent form of broadcast, based on a spanning tree rooted-atsource
–
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
31
Broadcast 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
32
Multicast 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
33
Routing 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
34
Classification of routing protocols

Multicast routing
 Unicast routing
–
Proactive protocols




–
Reactive 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
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
35
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”
–
[S]
S
B
A
E
F
C
G
H
I
M
J
K
Computer Networks, Jan-May 2004
L
D
N
36
Dynamic Source Routing (contd.)


Each node appends own identifier when forwarding RREQ
Issues concerning hidden terminal and of collisions again arise
S
[S,B]
E
[S,E]
F
B
C
[S,C]
A
M
J
H
L
G
K
I
Computer Networks, Jan-May 2004
D
N
37
Dynamic Source Routing (contd.)

DSR effectively uses flooding to discover a route to
destination
S
E
F
B
[S,E,F]
C
M
J
A
L
G
H
I
[S,C,G]
K
Computer Networks, Jan-May 2004
D
N
38
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]
S
E
F
B
C
M
J
A
[S,E,F,J]
G
H
L
D
K
I
[S,C,G,K]
Computer Networks, Jan-May 2004
N
39
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]
S
RREP [S,E,F,J,D]
E
F
B
C
M
J
A
L
G
H
K
I
Computer Networks, Jan-May 2004
D
N
40
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 bidirectional
– 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
41
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”
DATA [S,E,F,J,D]
S
E
F
B
C
M
J
A
L
G
H
K
I
Computer Networks, Jan-May 2004
D
N
42
Dynamic Source Routing (contd.)
– Intermediate nodes also cache relevant portions of the route
for their use
DATA [E,F,J,D]
S
E
F
B
C
M
J
A
L
G
H
K
I
Computer Networks, Jan-May 2004
D
N
43
Route 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
E
F
J
RREP [S,E,F,J,D]
D
Computer Networks, Jan-May 2004
44
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
S
E
F
B
[S,E,F]
C
M
J
A
L
G
H
I
[S,C,G]
K
Computer Networks, Jan-May 2004
D
N
45
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
46
Route 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]
route [S,E,F,J,D]
S
B
E
F
C
M
J
route
A [C, G, K, D]
H
L
G
K
I
Computer Networks, Jan-May 2004
D
N
47
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
RERR [J-D]
S
E
F
B
C
M
J
A
L
G
H
K
I
Computer Networks, Jan-May 2004
D
N
48
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
49
DSR: 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
50
Congestion, 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
51
Congestion, and its control

Difference between “flow control” and “congestion control”
–
Congestion has to do with networks carrying capacity

–
Congestion is a global issue


Flow control has to do with a destination node having to receive and process
incoming packets
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
52
Congestion 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




–
Exchange information with other nodes (particularly those responsible for
taking actions)

–
Queue lengths
packets dropped due to unavailability of buffers
Link utilization
Transit delay, and jitter
adds to congestion
Adjust network operation (re-schedule, re-route, drop packets, block traffic,
…)
Computer Networks, Jan-May 2004
53
Congestion control
Computer Networks, Jan-May 2004
54
Congestion 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
55
Congestion 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
56
Random Early Detection (RED) algorithm-based
congestion 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
57
Random Early Detection (RED) algorithm
Computer Networks, Jan-May 2004
58
Random Early Detection (RED) algorithm
Computer Networks, Jan-May 2004
59
Random Early Detection (RED) algorithm

Computation of average queue length
Computer Networks, Jan-May 2004
60
RED algorithm

Packets dropped
Computer Networks, Jan-May 2004
61
Quality of Service (QoS)

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.
Low delay/jitter == not sensitive to delay/jitter
Computer Networks, Jan-May 2004
62
QoS

Techniques:
–
Over-provision of resources

–
Buffering

–
Comes with its own limitation (hogging, …)
Basically counters the effect of large jitter
Traffic shaping

Comes with traffic policing, marking (or dropping)
Computer Networks, Jan-May 2004
63
QoS: traffic shaping

Leaky bucket
– Useful when a host generate bursty traffic, but at a higher rate
H_1
25MBps link
MUX
2 MBps link
H_2
…
H_n
Computer Networks, Jan-May 2004
64
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
65
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
66
QoS: traffic shaping using “token bucket”

Assume:
rate tokens are generated:  /sec
bucket size: C bytes
maximum output rate: M Bps
length of burst: S sec.
Then:
C + S = M S
Or
S = C/ (M- ), burst size in Bytes is MS
Burst=
1 MB
250 KB
token
bucket
500 KB
token
bucket
Computer Networks, Jan-May 2004
67
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
250 KB token
bucket
500 KB token
bucket
Burst= 1
MB
750 KB token
bucket
Computer Networks, Jan-May 2004
68
Resource 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
69
Admission 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
70
Routing


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
71
Routing (using MPLS)


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.
Computer Networks, Jan-May 2004
72
MPLS

Provides for a tunnel for each “equivalence class”
through a public network
– Provide secure communication
– Provide QoS guarantees (throughput, delay, drop rates, …)
IP network
MPLS network
IP network
128.1.47.1
128.1.47.3
128.1.47.2
IP network
Ingress router
IP network
Computer Networks, Jan-May 2004
Egress router
73
Tunnels
Computer Networks, Jan-May 2004
74
MPLS
MPLS I/F
Label In
MPLS I/F
LabelOut
…
…
…
…
3
…
50
…
1
…
99
…
128.1.47.1
3
3
1
2
2
IP I/F
DestAddr MPLS I/F
LabelOut
…
…
…
…
3 128.1.47.1
…
1
2
1
128.1.47.3
…
3
1
…
50
IP I/F
DestAddr MPLS I/F
Label In
…
…
…
…
1 128.1.47.1
…
…
3
…
99
…
…
Computer Networks, Jan-May 2004
75
MPLS

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
IP
routing
Ingress
router
LSP
Egress
router
Computer Networks, Jan-May 2004
76
Packet Scheduling

Queuing
–

Fair queuing
–

Hogging, no way to ensure QoS
Everyone gets the same share
Weighted fair queuing
–
Fair queuing with priority
Computer Networks, Jan-May 2004
77
Differentiated 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
78
Differentiated services

Expedited forwarding
– May be implemented using two separate queues, with say 20%
bandwidth reserved for expedired traffic
Computer Networks, Jan-May 2004
79
Differentiated services

Assured forwarding
– Different levels of priority
– Different drop probability for each “class”
Computer Networks, Jan-May 2004
80
Interconnected Networks


Internet is the prime example
Enterprise networks, that connect into the Internet
Computer Networks, Jan-May 2004
81
Interconnected Networks

Interconnected networks differ from each other several different
ways:
Computer Networks, Jan-May 2004
82
IP 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
83
IP 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
84
IP addressing

Several IP addresses are reserved, and have specific meaning,
pre-assigned to them
Computer Networks, Jan-May 2004
85
IP 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
86
IP addressing

The notion of “Mask”
Mask for Cambridge = 255.255.248.0
Mask for Edinburgh = 255.255.252.0
Mask for Oxford = 255.255.240.0

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.
11100 0010 0001 1000 0001 0000 0000 0000,
Or 194.24.16.0
Computer Networks, Jan-May 2004
87
IP packet format
version of the IP
protocol
Unique packet id
IP header length in
32 bit words
“do not fragment”
used for DiffServ
“more fragments”
Computer Networks, Jan-May 2004
length of header +
payload
Specified in terms
of “no of 8 bytes”
88
IP packet fragmentation

Basic principle
Computer Networks, Jan-May 2004
89
IP packet format
Helps to limit the no. of
hops or time spent in the
network
Source IP address
Protocol used to generate the
payload (TCP, UDP etc.)
Optional information,
such as source route
Computer Networks, Jan-May 2004
16 bit checksum,
covers header only
Destination IP address
90
Internet 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
91
ARP 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
92
ARP 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
93
ARP 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
94
ARP protocol: packet format
Computer Networks, Jan-May 2004
95
RARP 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
96
?

?
Computer Networks, Jan-May 2004
97
?

?
Computer Networks, Jan-May 2004
98
?

?
Computer Networks, Jan-May 2004
99
?

?
Computer Networks, Jan-May 2004
100
Thanks
Computer Networks, Jan-May 2004
101