0% found this document useful (0 votes)
85 views

Chapter 1,2,3 Notes

1. IP addresses are 32-bit logical addresses that uniquely identify devices on TCP/IP networks and the internet. They are divided into a network portion and host portion. 2. IPv4 addresses use 32 bits and are classified into 5 classes (A, B, C, D, E) that determine the number of networks and hosts. Private IP address ranges are also specified. 3. Classless addressing was introduced to allow more flexible allocation of address space and reduce routing table entries. It allows variable length blocks rather than fixed class sizes.

Uploaded by

Group Three
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

Chapter 1,2,3 Notes

1. IP addresses are 32-bit logical addresses that uniquely identify devices on TCP/IP networks and the internet. They are divided into a network portion and host portion. 2. IPv4 addresses use 32 bits and are classified into 5 classes (A, B, C, D, E) that determine the number of networks and hosts. Private IP address ranges are also specified. 3. Classless addressing was introduced to allow more flexible allocation of address space and reduce routing table entries. It allows variable length blocks rather than fixed class sizes.

Uploaded by

Group Three
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Unit – I Network Layer and Protocols

IP (INTERNET PROTOCOL) Addressing


“IP address is a logical address, 32 bit address having netid & hostid that uniquely &
universally identified over TCP/IP network or local network or to internet. Messages are
routed in a TCP/IP network based on destination IP address.”
Address Space and Notation:
A protocol like IPv4 that defines addresses has an address space. An Address Space is the
total number of addresses used by the protocol. If a protocol uses b bits to define an address,
the address space is 2b because each bit can have two different values (0 or 1). IPv4 uses 32-
bit addresses, which means that the address space is 232 or 4,294,967,296 (more than four
billion). If there were no restrictions, more than 4 billion devices could be connected to the
Internet.
Notations:
1. Binary Notations(Base 2)
2. Hexadecimal Notations(Base 16)
3. Dotted Decimal Natation(Base 256)
Classful Addressing
The IPv4 addresses are classified into 5 types as follows:
1 Class A
2 Class B
3 Class C
4 Class D
5 Class E

Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
IP Address is divided in to Network Portion and Host Portion

Class A is written as N.H.H.H

Class B is written as N.N.H.H

Class C is written as N.N.N.H

First Networ Host Number


First Number of
Class Byte k ID ID of
Bits Hosts
Values Bits Bits Networks
A 0 1 - 126 8 24 126 1,67,77,214
B 10 128 -191 16 16 16,384 65,534
192 -
C 110 24 8 2,097,152 254
223
NOH= 2n where n= host ID bits
NON= 2m-i where m = no of network ID bits, i= no of first bits

Private IP Address Range

Class Network Address


A 10.0.0.0 through 10.255.255.255
B 172.16.0.0 through 172.31.255.255
192.168.0.0 through
C
192.168.255.255

Classless Addressing
There are three main problems with “classful” addressing, which are somewhat related to
each other (making them a bit harder to explain).
1 Lack of Internal Address Flexibility: Big organizations are assigned large, “monolithic”
blocks of addresses that don't match well the structure of their underlying internal networks. 
2 Inefficient Use of Address Space: The existence of only three block sizes (classes A, B
and C) leads to waste of limited IP address space. 
3 Proliferation of Router Table Entries: As the Internet grows, more and more entries are
required for routers to handle the routing of IP datagrams, which causes performance
problems for routers. Attempting to reduce inefficient address space allocation leads to even
more router table entries.
The Internet authorities announced a new architecture called classless addressing. In classless
addressing, variable-length blocks are used that belong to no classes.
In classful addressing the whole address space was divided into five classes. Although each
organization was granted one block in class A, B, or C, the size of the blocks was predefined;
the organization needed to choose one of the three block sizes. The only block in class D and
the only block in class E were reserved for a special purpose.
In classless addressing, the whole address space is divided into variable length blocks.
Theoretically, we can have a block of 20, 21, 22, . . . , 232 addresses. The only restriction is that
the number of addresses in a block needs to be a power of 2. An organization can be granted
one block of addresses. Figure shows the division of the whole address space into non
overlapping blocks.

Figure: Variable-length blocks in classless addressing


Network Address Translation (NAT)
A technology that can provide the mapping between the private and universal addresses, and
at the same time support virtual private networks, is Network Address Translation (NAT).
Network Address Translation (NAT) is a process in which one or more local IP address is
translated into one or more Global IP address and vice versa in order to provide Internet
access to the local hosts. Also, it does the translation of port numbers i.e. masks the port
number of the host with another port number, in the packet that will be routed to destination.
It then makes the corresponding entries of ip address and port number in the NAT table. NAT
generally operates on router or firewall.

Internet Protocol (IP): Datagram Format

IPv4 defines the format of a packet in which the data coming from the upper layer or other
protocols are encapsulated. Packets used by the IP are called datagrams. Figure shows the
IPv4 datagram format. A datagram is a variable-length packet consisting of two parts: header
and payload (data). The header is 20 to 60 bytes in length and contains information essential
to routing and delivery.
 Version: The 4-bit version number (VER) field defines the version of Internet
Protocol. (e.g. IPv4).
 HLEN: The 4-bit header length (HLEN) field defines the total length of the datagram
header in 4-byte words.
 Service Type: The Service Type field is used to set priorities or precedence for data
transmission. The size of the field is 8 bits. This field is also used to determine the type
of service that is required for a particular application. The priority is set using the first
three bits and the service type is set using the next three bits. The last two bits are
reserved for future use. The Service Type field has two components, Precedence and
Types of Service.
 Total Length: This 16-bit field defines the total length (header plus data) of the IP
datagram in bytes. A 16-bit number can define a total length of up to 65,535.
Total length of the datagram = Length of the header + Length of the data
 Identification: If IP packet is fragmented during the transmission, all the fragments
contain same identification number. To identify original IP packet they belong to.
 Flags: As required by the network resources, if IP Packet is too large to handle, these
‘flags’ tells if they can be fragmented or not. In this 3-bit flag, the MSB is always set to
‘0’.
 Fragment Offset: This offset tells the exact position of the fragment in the original IP
Packet.
 Time to Live: To avoid looping in the network, every packet is sent with some TTL
value set, which tells the network how many routers (hops) this packet can cross. At
each hop, its value is decremented by one and when the value reaches zero, the packet is
discarded.
 Protocol: Tells the Network layer at the destination host, to which Protocol this packet
belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP
is 6 and UDP is 17.
 Header Checksum: This field is used to keep checksum value of entire header which
is then used to check if the packet is received error-free.
 Source Address: 32-bit address of the Sender (or source) of the packet.
 Destination Address: 32-bit address of the Receiver (or destination) of the packet.
 Options: A datagram header can have up to 40 bytes of options. Options can be used
for network testing and debugging. These options may contain values for options such as
Security, Record Route, Time Stamp, etc.

Fragmentation
IP fragmentation is an Internet Protocol (IP) process that breaks packets into smaller pieces
(fragments), so that the resulting pieces can pass through a link with a smaller MTU
(maximum transmission unit) than the original packet size. The fragments are reassembled by
the receiving host.
Maximum Transfer Unit (MTU)
Each data link layer protocol has its own frame format in most protocols. One of the
fields defined in the format is the maximum size of the data field. In other words, when
a datagram is encapsulated in a frame, the total size of the datagram must be less than
this maximum size, which is defined by the restrictions imposed by the hardware and
software used in the network (see Figure).

The value of the MTU differs from one physical network protocol to another.
Options.
Protocol MTU
Hyperchannel 65,535
Token Ring(16Mbps) 17,914
Token Ring(4Mbps) 4,464
FDDDI 4,352
Ethernet 1,500
X.25 576
PPP 296
Fields Related to Fragmentation
The fields that are related to fragmentation and reassembly of an IP datagram are the
identification, flags, and fragmentation offset fields.
Identification
i. This 16-bit field identifies a datagram originating from the source host. The combination of
the identification and source IP address must uniquely define a datagram as it leaves the
source host.
ii. To guarantee uniqueness, the IP protocol uses a counter to label the datagrams. The
counter is initialized to a positive number.
iii. When the IP protocol sends a datagram, it copies the current value of the counter to the
identification field and increments the counter by one.
iv. As long as the counter is kept in the main memory, uniqueness is guaranteed. When a
datagram is fragmented, the value in the identification field is copied into all fragments.
v. In other words, all fragments have the same identification number, which is also the same
as the original datagram.
vi. The identification number helps the destination in reassembling the datagram. It knows
that all fragments having the same identification value should be assembled into one
datagram.
Flags
i. This is a three-bit field. The first bit is reserved (not used). The second bit is called the do
not fragment bit.
ii. If its value is 1, the machine must not fragment the datagram. If it cannot pass the
datagram through any available physical network, it discards the datagram and sends an
ICMP error message to the source host. If its value is 0, the datagram can be fragmented if
necessary.
iii. The third bit is called the more fragment bit.
iv. If its value is 1, it means the datagram is not the last fragment; there are more fragments
after this one. If its value is 0, it means this is the last or only fragment.

Fragmentation offset
i. This 13-bit field shows the relative position of this fragment with respect to the whole
datagram.
ii. It is the offset of the data in the original datagram measured in units of 8 bytes. Figure
shows a datagram with a data size of 4000 bytes fragmented into three fragments. The bytes
in the original datagram are numbered 0 to 3999. The first fragment carries bytes 0 to 1399.
iii. The offset for this datagram is 0/8= 0. The second fragment carries bytes 1400 to 2799;
the offset value for this fragment is 1400/8= 175.
iv. Finally, the third fragment carries bytes 2800 to 3999. The offset value for this fragment is
2800/8= 350.
Options
The header of the IP datagram is made of two parts: a fixed part and a variable part. The
fixed part is 20 bytes long. The variable part comprises the options, which can be a maximum
of 40 bytes.
Options are not required for a datagram. They can be used for network testing and debugging.
Although options are not a required part of the IP header, option processing is required of the
IP software. This means that all implementations must be able to handle options if they are
present in the header.

Type
The type field is 8 bits long and contains three subfields: copy, class, and number.
❑ Copy. This 1-bit subfield controls the presence of the option in fragmentation.
When its value is 0, it means that the option must be copied only to the first fragment.
If its value is 1, it means the option must be copied to all fragments.
❑ Class. This 2-bit subfield defines the general purpose of the option. When its value
is 00, it means that the option is used for datagram control. When its value is 10, it
means that the option is used for debugging and management. The other two possible
values (01 and 11) have not yet been defined.
❑ Number. This 5-bit subfield defines the type of option. Although 5 bits can define
up to 32 different types, currently only 6 types are in use.
0 - Special case indicating the end of the option list, in this case the option field is just one
octet as no length or data fields are present.
1 - No Operation, again the option field is just one octet with no length or data fields.
3 - Loose Source Routing which is IP routing based on information supplied by the source
station where the routers can forward the datagram to any number of intermediate routers in
order to get to the destination.
4 - Internet Timestamp. A timestamp option is used to record the time of datagram processing
by a router.
7 - Record Route records the route that a datagram takes.
9 - Strict Source Routing which is IP routing based on information supplied by the source
station where the routers can only forward the datagram to a directly connected router in
order to get to the next hop indicated in the source route path.
Length
The length field defines the total length of the option including the type field and the length
field itself. This field is not present in all of the option types.
Value
The value field contains the data that specific options require. Like the length field, this
field is also not present in all option types.
ICMPv4:
ICMP (Internet Control Message Protocol) is an error-reporting protocol network devices like
routers use to generate error messages to the source IP address when network problems
prevent delivery of IP packets. ICMP creates and sends messages to the source IP address
indicating that a gateway to the Internet that a router, service or host cannot be reached for
packet delivery. Any IP network device has the capability to send, receive or process ICMP
messages.
The value of the protocol field in the IP datagram is 1 to indicate that the IP data is an ICMP
message.

Figure: ICMP encapsulation


Messages
ICMP messages are divided into two broad categories: error-reporting messages and query
messages.
The error-reporting messages report problems that a router or a host (destination) may
encounter when it processes an IP packet. The query messages, which occur in pairs, help a
host or a network manager get specific information from a router or another host.
For example, nodes can discover their neighbours. Also, hosts can discover and learn about
routers on their network and routers can help a node redirect its messages.

Table: ICMP messages


An ICMP message has an 8-byte header and a variable-size data section. Although the
general format of the header is different for each message type, the first 4 bytes are common
to all. As Figure shows, the first field, ICMP type, defines the type of the message. The code
field specifies the reason for the particular message type. The last common field is the
checksum field. The rest of the header is specific for each message type.
The data section in error messages carries information for finding the original packet that had
the error. In query messages, the data section carries extra information based on the type of
the query.
Figure: General format of ICMP messages

Debugging Tools
There are several tools that can be used in the Internet for debugging. We can find if a host or
router is alive and running. We can trace the route of a packet. We introduce two tools that
use ICMP for debugging: ping and traceroute

Ping:
Ping is a computer network administration software utility used to test the reachability of a
host on an Internet Protocol (IP) network.
Ping operates by sending Internet Control Message Protocol (ICMP) echo request packets to
the target host and waiting for an ICMP echo reply. The program reports errors, packet loss,
and a statistical summary of the results, typically including the minimum, maximum, the
mean round-trip times, and standard deviation of the mean.
Traceroute:
The traceroute program in UNIX or tracert in Windows can be used to trace the route
of a packet from the source to the destination.
The traceroute command uses ICMP Time Exceeded messages to trace a network route. As
the Time to Live field is used in IP to avoid routing loops: every time a packet passes through
a router, the router decrements the TTL field. If the TTL reaches zero, the router drops the
packet and sends an ICMP Time Exceeded message to the original sender.
The client then sends a packet with a TTL of 2 to the server. Router A decrements the TTL to
1 and passes the packet to router B. Router B decrements the TTL to 0, drops it, and sends an
ICMP Time Exceeded message to the client. Router B is now identified. This process
continues until the server is reached, as shown in Figure, identifying all routers along the
route.

Figure: Traceroute
ICMP Checksum
The error detection method used by most TCP/IP protocols is called the checksum.
The checksum protects against the corruption that may occur during the transmission of a
packet. It is redundant information added to the packet.
The checksum is calculated at the sender and the value obtained is sent with the packet. The
receiver repeats the same calculation on the whole packet including the checksum. If the
result is satisfactory, the packet is accepted; otherwise, it is rejected.
In ICMP the checksum is calculated over the entire message (header and data).
Checksum Calculation
The sender follows these steps using one’s complement arithmetic:
1. The checksum field is set to zero.
2. The sum of all the 16-bit words (header and data) is calculated.
3. The sum is complemented to get the checksum.
4. The checksum is stored in the checksum field.
Checksum Testing
The receiver follows these steps using one’s complement arithmetic:
1. The sum of all words (header and data) is calculated.
2. The sum is complemented.
3. If the result obtained in step 2 is 16 0s, the message is accepted; otherwise, it is rejected.

Figure: Example of checksum calculation

Mobile IP:
A. Addressing
Mobile IP is a communication protocol (created by extending Internet Protocol, IP) that
allows the users to move from one network to another with the same IP address. It ensures
that the communication will continue without user’s sessions or connections being dropped.
a) Stationary Hosts
The original IP addressing was based on the assumption that a host is stationary, attached to
one specific network. A router uses an IP address to route an IP datagram.
b) Mobile Hosts
When a host moves from one network to another, the IP addressing structure needs to
be modified. Several solutions have been proposed.
i. Changing the Address
One simple solution is to let the mobile host change its address as it goes to the new
network. The host can use DHCP to obtain a new address to associate it with the new
network.
This approach has several drawbacks.
First, the configuration files would need to be changed.
Second, each time the computer moves from one network to another, it must be rebooted.
Third, the DNS tables need to be revised so that every other host in the Internet is aware of
the change.
Fourth, if the host roams from one network to another during a transmission, the data
exchange will be interrupted. This is because the ports and IP addresses of the client and the
server must remain constant for the duration of the connection.
ii. Two Addresses
The approach that is more feasible is the use of two addresses. The host has its original
address, called the home address, and a temporary address, called the care-of address.
The home address is permanent; it associates the host to its home network, the network
that is the permanent home of the host. The care-of address is temporary. When a host moves
from one network to another, the care-of address changes; it is associated with the foreign
network, the network to which the host moves. Figure shows the concept.

Figure: - Home address and care-of address

B. Agents,
To make the change of address transparent to the rest of the Internet requires a Home Agent
and a Foreign Agent.
Figure shows the position of a Home Agent relative to the Home Network and a Foreign
Agent relative to the Foreign Network.

Figure: - Home agent and foreign agent


Home Agent
The home agent is usually a router attached to the home network of the mobile host.
The home agent acts on behalf of the mobile host when a remote host sends a packet to
the mobile host. The home agent receives the packet and sends it to the foreign agent.
Foreign Agent
The foreign agent is usually a router attached to the foreign network. The foreign agent
receives and delivers packets sent by the home agent to the mobile host.
The mobile host can also act as a foreign agent. In other words, the mobile host and the
foreign agent can be the same.
When the mobile host and the foreign agent are the same, the care-of address is called a
co-located care-of address.
C. Three Phases
To communicate with a remote host, a mobile host goes through three phases: agent
discovery, registration, and data transfer, as shown in Figure.
The first phase, agent discovery, involves the mobile host, the foreign agent, and the home
agent. The second phase, registration, also involves the mobile host and the two agents.
Finally, in the third phase, the remote host is also involved.
Figure: - Remote host and mobile host communication
a) Agent Discovery
The first phase in mobile communication, agent discovery, consists of two subphases. A
mobile host must discover (learn the address of) a home agent before it leaves its home
network. A mobile host must also discover a foreign agent after it has moved to a foreign
network. This discovery consists of learning the care-of address as well as the foreign agent’s
address. The discovery involves two types of messages: advertisement and solicitation.

Agent Advertisement
When a router advertises its presence on a network using an ICMP router advertisement, it
can append an agent advertisement to the packet if it acts as an agent.
Mobile IP does not use a new packet type for agent advertisement; it uses the router
advertisement packet of ICMP, and appends an agent advertisement message.
Agent Solicitation
When a mobile host has moved to a new network and has not received agent advertisements,
it can initiate an agent solicitation. It can use the ICMP solicitation message to inform an
agent that it needs assistance.
Mobile IP does not use a new packet type for agent solicitation; it uses the router solicitation
packet of ICMP.
b) Registration
Mobile node after discovering the foreign agent, sends registration request (RREQ) to the
foreign agent. Foreign agent in turn, sends the registration request to the home agent with the
care-of-address. Home agent sends registration reply (RREP) to the foreign agent. Then it
forwards the registration reply to the mobile node and completes the process of registration.
c) Data transfer
The Mobile Node sends packets using its home IP address, effectively maintaining the
appearance that it is always on its home network. Even while the Mobile Node is roaming on
foreign networks, its movements are transparent to correspondent nodes.
Data packets addressed to the Mobile Node are routed to its home network, where the Home
Agent now intercepts and tunnels them to the care-of address toward the Mobile Node.
Tunnelling has two primary functions: encapsulation of the data packet to reach the tunnel
endpoint, and decapsulation when the packet is delivered at that endpoint. The default tunnel
mode is IP Encapsulation within IP Encapsulation. Optionally, Generic Routing
Encapsulation (GRE) and minimal encapsulation within IP may be used.
Typically, the Mobile Node sends packets to the Foreign Agent, which routes them to their
final destination, the Correspondent Node, as shown in Figure.
Figure: - Data transfer
D. Inefficiency in Mobile IP
Communication involving mobile IP can be inefficient. The inefficiency can be severe
or moderate. The severe case is called double crossing or 2X. The moderate case is called
triangle routing or dog-leg routing.
Double Crossing
Double crossing occurs when a remote host communicates with a mobile host that has
moved to the same network (or site) as the remote host (see Figure).

Figure: - Double crossing


When the mobile host sends a packet to the remote host, there is no inefficiency; the
communication is local. However, when the remote host sends a packet to the mobile host,
the packet crosses the Internet twice. Since a computer usually communicates with other local
computers (principle of locality), the inefficiency from double crossing is significant.
Triangle Routing
Triangle routing, the less severe case, occurs when the remote host communicates with a
mobile host that is not attached to the same network (or site) as the mobile host. When the
mobile host sends a packet to the remote host, there is no inefficiency. However, when the
remote host sends a packet to the mobile host, the packet goes from the remote host to the
home agent and then to the mobile host. The packet travels the two sides of a triangle, instead
of just one side (see Figure).

Figure: -Triangle routing


Virtual Private Network: VPN Technology
One of the applications of IPsec is in virtual private networks. A virtual private network
(VPN) is a technology that is gaining popularity among large organizations that use the
global Internet for both intra- and inter-organization communication, but require privacy
in their intra-organization communication. VPN is a network that is private but virtual. It
is private because it guarantees privacy inside the organization. It is virtual because it
does not use real private WANs; the network is physically public but virtually private.
Figure shows the idea of a virtual private network. Routers R1 and R2 use VPN technology
to guarantee privacy for the organization. VPN technology uses ESP protocol of IPSec in the
tunnel mode. A private datagram, including the header, is encapsulated in an ESP
(Encapsulating Security Payload) packet. The router at the border of the sending site uses its
own IP address and the address of the router at the destination site in the new datagram. The
public network (Internet) is responsible for carrying the packet from R1 to R2. Outsiders
cannot decipher the contents of the packet or the source and destination addresses.
Deciphering takes place at R2, which finds the destination address of the packet and delivers
it.

Fig: - Virtual private network


Additional Notes

Figure: - Mobile IP supports the ability of nodes to change their point of network attachment
and keep network connections operating. The mobile node’s home agent helps to forward
traffic for mobiles it serves and also plays a role in route optimization, which can
substantially improve routing performance by allowing mobile and correspondent nodes to
communicate directly.
Mobile Node (MN):
It is the hand-held communication device that the user caries e.g. Cell phone.
Home Network:
It is a network to which the mobile node originally belongs to as per its assigned IP address
(home address).
Home Agent (HA):
It is a router in home network to which the mobile node was originally connected
Home Address:
It is the permanent IP address assigned to the mobile node (within its home network).
Foreign Network:
It is the current network to which the mobile node is visiting (away from its home network).
Foreign Agent (FA):
It is a router in foreign network to which mobile node is currently connected. The packets
from the home agent are sent to the foreign agent which delivers it to the mobile node.
Correspondent Node (CN):
It is a device on the internet communicating to the mobile node.
Care of Address (COA):
It is the temporary address used by a mobile node while it is moving away from its home
network.
Unit– II Next Generation IP

2.1 IPv6 Addressing:


2.1.1 Representation
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block is then
converted into 4-digit Hexadecimal numbers separated by colon symbols.
For example, given below is a 128 bit IPv6 address represented in binary format and divided
into eight 16-bits blocks:
0010000000000001 0000000000000000 0011001000111000 1101111111100001
0000000001100011 0000000000000000 0000000000000000 1111111011111011
Each block is then converted into Hexadecimal and separated by ‘:’ symbol:
2001:0000:3238: DFE1:0063:0000:0000: FEFB
Even after converting into Hexadecimal format, IPv6 address remains long. IPv6 provides
some rules to shorten the address. The rules are as follows:
Rule.1: Discard leading Zero(es):
In Block 5, 0063, the leading two 0s can be omitted, such as (5th block):
2001:0000:3238:DFE1:63:0000:0000:FEFB
Rule.2: If two of more blocks contain consecutive zeroes, omit them all and replace with
double colon sign ::, such as (6th and 7th block):
2001:0000:3238:DFE1:63::FEFB
Consecutive blocks of zeroes can be replaced only once by :: so if there are still blocks of
zeroes in the address, they can be shrunk down to a single zero, such as (2nd block):
2001:0:3238:DFE1:63::FEFB
CIDR Notation:
IPv6 allows classless addressing and CIDR notation.
Example fig shows how we can define a prefix of 60 bits using CIDR.
FDEC::BBFF:0:FFFF/60
Fig: CIDR Address
2.1.2 Address Space
The address space of IPv6 contains 2128 addresses as shown below. This address space is 296
times of the IPv4 address definitely no address depletion.
340,282,366,920,938,463,374,607,431,768,211,456
Three Address Types
IPv6, a destination address can belong to one of three categories: unicast, anycast,
and multicast.
Unicast address
This address identifies a single interface. A data packet sent to a unicast address is delivered
only to the interface that is identified by that address.
Anycast address
This address identifies a set of interfaces. A data packet sent to an anycast address is
delivered to the nearest interface (according to the routing protocols' measure of distance)
that is identified by that address.
Multicast address
This address identifies a set of interfaces. A data packet sent to a multicast address is
delivered to all the interfaces that are identified by that address.
2.1.3 Address Space Allocation
the address space of IPv6 is divided into several blocks of varying size and each block is
allocated for special purpose. Most of the blocks are still unassigned and have been left aside
for future use.
Each section is one-eighth of the whole address space (2125 addresses). The first section
contains six variable-size blocks; three of these blocks are reserved and three unassigned. The
second section is considered one single block and is used for global unicast addresses. The
next five sections are unassigned addresses. The last section is divided into eight blocks.
Some of these blocks are still unassigned and some are reserved for special purposes. The
figure shows that more than five-eighths of the address space is still unassigned. Only one-
eighth of the address space is used for unicast communication between the users.

Figure: Address space allocation


Table shows the prefix for each type of address. The third column shows the fraction of each
type of address relative to the whole address space. The leftmost column is not part of the
standard; it shows only the section described in Figure

Table: Prefixes for IPv6 Addresses


2.1.4 Autoconfiguration
One of the interesting features of IPv6 addressing is the autoconfiguration of hosts. In IPv6,
DHCP protocol can be used to allocate an IPv6 address to a host, but a host can also
configure itself.
When a host in IPv6 joins a network, it can configure itself using the following process:
1 Link-Local Address Generation: The host first creates a link local address for itself. This is
by taking the 10-bit link local prefix (1111 1110 10), adding 54 zeros, and adding the 64-bit
interface identifier, which any host knows how to generate it from its interface card. The
result is a 128-bit link local address.
2 Link-Local Address Uniqueness Test: The host then tests to see if this link local address is
unique and not used by other hosts. Since the 64-bit interface identifier is supposed to be
unique, the link local address generated is unique with a high probability. However, to be
sure, the host sends a neighbour solicitation message and waits for neighbour advertisement
message. If any host in the subnet is using this link local address, the process fails and the
host cannot autoconfigure itself; it needs to use other means such as DHCP protocol for this
purpose.
3 Link-Local Address Assignment: If the uniqueness of the link local address is passed, the
host stores this address as its link-local address (for private communication), but it still needs
a global unicast address (for public communication).
4 Global Address Configuration: The host then sends a router solicitation message to a local
router. If there is a router running on the network, the host receives a router advertisement
message that includes the global unicast prefix and the subnet prefix that the host needs to add
to its interface identifier to generate its global unicast address.
5 Router Direction: If the router cannot help the host with the configuration, it informs the
host in the router advertisement message (by setting a flag). The host then needs to use other
means for configuration.
2.1.5 Renumbering
To allow sites to change the service provider, renumbering of the address prefix (n)
was built into IPv6 addressing. Each site is given a prefix by the service provider to which it
is connected. If the site changes the provider, the address prefix needs to be changed. A router
to which the site is connected can advertise a new prefix and let the site use the old prefix for
a short time before disabling it. In other words, during the transition period, a site has two
prefixes. The main problem in using the renumbering mechanism is the support of the DNS,
which needs to propagate the new addressing associated with a domain name. A new protocol
for DNS, called Next Generation DNS, is under study to provide support for this mechanism.
2.2 Transition from IPv4 to IPv6:
There are three strategies dual stack, header translation, tunnelling. One or all of these three
strategies can be implemented during the transition period.
2.2.1 Dual Stack
It is recommended that all hosts, before migrating completely to version 6, have a dual
stack of protocols. In other words, a station must run IPv4 and IPv6 simultaneously until
all the Internet uses IPv6. See Figure for the layout of a dual-stack configuration.
Figure: Dual stack
To determine which version to use when sending a packet to a destination, the source host
queries the DNS. If the DNS returns an IPv4 address, the source host sends an IPv4 packet. If
the DNS returns an IPv6 address, the source host sends an IPv6 packet.
2.2.2 Tunneling
Tunneling is a strategy used when two computers using IPv6 want to communicate
with each other and the packet must pass through a region that uses IPv4. To pass through
this region, the packet must have an IPv4 address. So the IPv6 packet is encapsulated
in an IPv4 packet when it enters the region, and it leaves its capsule when it exits the region.
It seems as if the IPv6 packet goes through a tunnel at one end and emerges at the other end.
To make it clear that the IPv4 packet is carrying an IPv6 packet as data, the protocol value
is set to 41(IPv6). Tunneling is shown in Figure.

Figure: Tunneling strategy


2.2.3 Header Translation
Header translation is necessary when the majority of the Internet has moved to IPv6
but some systems still use IPv4. The sender wants to use IPv6, but the receiver does not
understand IPv6. Tunneling does not work in this situation because the packet must be
in the IPv4 format to be understood by the receiver. In this case, the header format must
be totally changed through header translation. The header of the IPv6 packet is converted
to an IPv4 header (see Figure).

Figure: Header translation strategy


Header translation uses the mapped address to translate an IPv6 address to an IPv4
address.
The following lists some rules used in transforming an IPv6 packet header to
an IPv4 packet header.
❑The IPv6 mapped address is changed to an IPv4 address by extracting the rightmost
32 bits.
❑ The value of the IPv6 priority field is discarded.
❑ The type of service field in IPv4 is set to zero.
❑ The checksum for IPv4 is calculated and inserted in the corresponding field.
❑ The IPv6 flow label is ignored.
❑ Compatible extension headers are converted to options and inserted in the IPv4
header. Some may have to be dropped.
❑ The length of IPv4 header is calculated and inserted into the corresponding field.
❑ The total length of the IPv4 packet is calculated and inserted in the corresponding
field.
2.3 IPv6 Protocol:
2.3.1 Packet format
IPv6 datagram
The IPv6 packet is shown in Figure. Each packet is composed of a mandatory
base header followed by the payload. The payload consists of two parts: optional
extension headers and data from an upper layer. The base header occupies 40 bytes,
whereas the extension headers and data from the upper layer contain up to 65,535 bytes
of information.

Figure: IPv6 datagram


Base Header
Figure shows the base header with its eight fields.

Figure: Format of the base header


These fields are as follows:
1 Version. This 4-bit field defines the version number of the IP. For IPv6, the value is 6.
2 Traffic Class. This 8-bit field is used to distinguish different payloads with different
delivery requirements. It replaces the service class field in IPv4.
3 Flow labels. The flow label is a 20-bit field that is designed to provide special handling for
a particular flow of data.
4 Payload length. The 2-byte payload length field defines the length of the IP datagram
excluding the base header.
5 Next header. The next header is an 8-bit field defining the header that follows the
base header in the datagram. The next header is either one of the optional extension headers
used by IP or the header of an encapsulated packet such as UDP or TCP. Each extension
header also contains this field. Table shows the values of next headers. Note that this field in
version 4 is called the protocol.

Table: Next Header Codes


6 Hop limit. This 8-bit hop limit field serves the same purpose as the TTL field in IPv4.
7 Source address. The source address field is a 16-byte (128-bit) Internet address that
identifies the original source of the datagram.
8 Destination address. The destination address field is a 16-byte (128-bit) Internet address
that usually identifies the final destination of the datagram. However, if source routing is
used, this field contains the address of the next router.
2.3.2 Extension Header
The length of the base header is fixed at 40 bytes. However, to give more functionality to the
IP datagram, the base header can be followed by up to six extension headers.
Many of these headers are options in IPv4. Figure shows the extension header format.

Figure: Extension header format


Six types of extension headers have been defined. These are hop-by-hop option, source
routing, fragmentation, authentication, encrypted security payload, and destination option
(see Figure).

Figure: Extension header types


Hop-by-Hop Option
The hop-by-hop option is used when the source needs to pass information to all routers
visited by the datagram. For example, maybe routers must be informed about certain
management, debugging, or control functions. Or, if the length of the datagram is more than
the usual 65,535 bytes, routers must have this information. Figure shows the format of the
hop-by-hop option header. The first field defines the next header in the chain of headers. The
header length defines the number of bytes in the header (including the next header field). The
rest of the header contains different options.

Figure: Hop-by-hop option header format


So far, only three hop-by-hop options have been defined: Pad1, PadN, and jumbo payload.
Figure shows the general format of the option.

Figure: The format of options in a hop-by-hop option header


1 Pad1- This option is 1 byte long and is designed for alignment purposes. Some options
need to start at a specific bit of the 32-bit word If an option falls short of this requirement by
exactly one byte, Pad1 is added to make up the difference. Pad1 contains neither the option
length field nor the option data field. It consists solely of the option code field with all bits set
to 0 (action is 00, the change bit is 0, and type is 00000). Pad1 can be inserted anywhere in
the hop-by-hop option header (see Figure).

2 PadN - PadN is similar in concept to Pad1. The difference is that PadN is used when 2 or
more bytes are needed for alignment. This option consists of 1 byte of option code, 1 byte of
the option length, and a variable number of zero padding bytes. The value of the option code
is 1 (action is 00, the change bit is 0, and type is 00001). The option length contains the
number of padding bytes. See Figure.

Figure: PadN
3 Jumbo payload- Recall that the length of the payload in the IP datagram can be a
maximum of 65,535 bytes. However, if for any reason a longer payload is required, we can
use the jumbo payload option to define this longer length. The jumbo payload option must
always start at a multiple of 4 bytes plus 2 from the beginning of the extension headers. The
jumbo payload option starts at the (4n+2) byte, where n is a small integer. See Figure.
Figure: Jumbo payload
Destination Option
The destination option is used when the source needs to pass information to the destination
only. Intermediate routers are not permitted access to this information. The format of the
destination option is the same as the hop-by-hop option. So far, only the Pad1 and PadN
options have been defined.
Source Routing
The source routing extension header combines the concepts of the strict source route and the
loose source route options of IPv4. The source routing header contains a minimum of seven
fields (see Figure). The first two fields, next header and header length, are identical to that of
the hop-by-hop extension header. The type field defines loose or strict routing. The addresses
left field indicates the number of hops still needed to reach the destination. The strict/loose
mask field determines the rigidity of routing. If set to strict, routing must follow exactly as
indicated by the source. If, instead, the mask is loose, other routers may be visited in addition
to those in the header.

Figure: Source routing


The destination address in source routing does not conform to our previous definition
(the final destination of the datagram). Instead, it changes from router to router.
For example, in Figure, Host A wants to send a datagram to Host B using a specific
route: A to R1 to R2 to R3 to B. Notice the destination address in the base headers. It is not
constant as you might expect. Instead, it changes at each router. The addresses in the
extension headers also change from router to router.

Figure: Source routing example


Fragmentation
The concept of fragmentation is the same as that in IPv4. However, the place where
fragmentation occurs differs. In IPv4, the source or a router is required to fragment if
the size of the datagram is larger than the MTU of the network over which the datagram
travels. In IPv6, only the original source can fragment. A source must use a Path MTU
Discovery technique to find the smallest MTU supported by any network on the path.
The source then fragments using this knowledge.
If the source does not use a Path MTU Discovery technique, it fragments the datagram
to a size of 1,280 bytes or smaller. This is the minimum size of MTU required for each
network connected to the Internet. Figure shows the format of the fragmentation extension
header.

Figure: Fragmentation
Authentication-
The authentication extension header has a dual purpose: it validates the message sender and
ensures the integrity of data. The former is needed so the receiver can be sure that a message
is from the genuine sender and not from an imposter. The latter is needed to check that the
data is not altered in transition by some hacker.
The format of the authentication extension header is shown in Figure 1. The security
parameter index field defines the algorithm used for authentication. The authentication data
field contains the actual data generated by the algorithm.
Many different algorithms can be used for authentication. Figure 2 outlines the method for
calculating the authentication data field. The sender passes a 128-bit security key, the entire
IP datagram, and the 128-bit security key again to the algorithm. Those fields in the datagram
with values that change during transmission (for example, hop count) are set to zero. The
datagram passed to the algorithm includes the authentication header extension, with the
authentication data field set to zero. The algorithm creates authentication data which is
inserted into the extension header prior to datagram transmission.
The receiver functions in a similar manner. It takes the secret key and the received datagram
(again, with changeable fields set to zero) and passes them to the authentication algorithm. If
the result matches that in the authentication data field, the IP datagram is authentic;
otherwise, the datagram is discarded.

Figure 1 Authentication

Figure 2 Calculation of authentication data


Encrypted Security Payload
The encrypted security payload (ESP) is an extension that provides confidentiality and guards
against eavesdropping. Figure shows the format. The security parameter index field is a 32-
bit word that defines the type of encryption/decryption used. The other field contains the
encrypted data along with any extra parameters needed by the algorithm. Encryption can be
implemented in two ways: transport mode or tunnel mode.
Figure: Encrypted security payload
Map the given IPv4 address to IPv6 address.
A mapped address comprises 80 bits of zero, followed by 16 bits of one, followed by the 32-
bit IPv4 address. It is used when a computer that has migrated to IPv6 wants to send a packet
to a computer still using IPv4. The packet travels mostly through IPv6 networks but is finally
delivered to a host that uses IPv4.
For example, the IPv4 address 2.13.17.14 (in dotted decimal format) becomes
0::FFFF:2.13.17.14 (in hexadecimal colon format). The IPv4 address is prepended with 16
ones and 80 zeros to create a 128-bit IPv6 address. Figure shows a mapped address.

Figure: Mapped address


Unit III- Unicast and Multicast Routing Protocols
3.1 Introduction:
Inter-domain, Intradomain Routing.
Autonomous System- An internet is divided into Autonomous System. An Autonomous
System is a group of networks and routers under the authority of a single administration.

Intradomain Routing - Routing inside an Autonomous System is Referred to as Intra-domain


Routing
Inter-domain - Routing between Autonomous Systems is Referred to as Inter-domain.

S.N
INTRADOMAIN ROUTING INTERDOMAIN ROUTING
O

Routing algorithm works only Routing algorithm works within and


1.
within domains. between domains.

It needs to know only about other It need to know only about other routers
2.
routers within their domain. within and between their domain.

Protocols used in intradomain


Protocols used in interdomain routing are
3. routing are known as Interior-
known as Exterior-gateway protocols.
gateway protocols.

In this Routing, routing takes place In this Routing, routing takes place
4.
within an autonomous network. between the autonomous networks.

Intradomain routing protocols Interdomain routing protocol assumes that


5. ignores the internet outside the the internet contains the collection of
AS(autonomous system). interconnected AS(autonomous systems).

Some Popular Protocols of this Popular Protocols of this routing is


routing are RIP(resource BGP(Border Gateway Protocol) used to
6.
information protocol) and connect two or more AS(autonomous
OSPF(open shortest path first). system).

3.2 Routing Algorithms:


3.2.1 Distance Vector Routing
In distance-vector routing, each node creates is its own least-cost tree with the basic
information it has about its immediate neighbours. The incomplete trees are exchanged
between immediate neighbours to make the trees more and more complete and to represent
the whole internet. We can say that in distance-vector routing, a router continuously tells all
of its neighbours what it knows about the whole internet.
3.2.2 Bellman–Ford algorithm
The algorithm can be used in many applications in graph theory. If we know the cost between
each pair of nodes, we can use the algorithm to find the least cost (shortest path) between any
two nodes. Figure 1 shows a map with nodes and lines. The cost of each line is given over the
line; the algorithm can find the least cost between any two nodes. For example, if the nodes
represent cities and the lines represent roads connecting them, the graph can find the shortest
distance between any two cities.

Figure 1: A graph for the Bellman-Ford algorithm

The algorithm is based on the fact that if all neighbours of node i know the shortest distance
to node j, then the shortest distance between node i and j can be found by adding the distance
between node i and each neighbour to the neighbour’s shortest distance to node j and then
select the minimum, as shown in figure 2.

Figure 2: The fact behind Bellman-Ford algorithm


We create a shortest distance table (vector) for each node using the following steps:
1. The shortest distance and the cost between a node and itself is initialized to 0.
2. The shortest distance between a node and any other node is set to infinity. The cost
between a node and any other node should be given.
3. The algorithm repeat as shown in Figure2 until there is no more change in the shortest
distance vector.
3.2.3 Distance Vector Routing Algorithm
The Bellman-Ford algorithm is design to create the result synchronously. If we want to use
the algorithm for creating the routing table for routers in an AS, we need to change the
algorithm.
Distance Vector Routing Algorithm:
1. In distance vector routing, the cost is normally hop counts (how many networks are
passed before reaching the destination). So the cost between any two neighbours is set to 1.
2. Each router needs to update its routing table asynchronously, whenever it has received
some information from its neighbours. In other words, each router executes part of the whole
algorithm in the Bellman-Ford algorithm. Processing is distributive.
3. After a router has updated its routing table, it should send the result to its neighbours so
that they can also update their routing table.

3.2.4 Link State Routing


Link state routing has a different philosophy from that of distance vector routing. In
link state routing, if each node in the domain has the entire topology of the domain—
the list of nodes and links, how they are connected including the type, cost (metric), and
the condition of the links (up or down)—the node can use the Dijkstra algorithm to build a
routing table. Figure. shows the concept.

Figure: Concept of link state routing

The figure shows a simple domain with five nodes. Each node uses the same topology to
create a routing table, but the routing table for each node is unique because the calculations
are based on different interpretations of the topology. This is similar to a city map. Two
persons in two different cities may have the same map, but each needs to take a different
route to reach his destination.
The topology must be dynamic, representing the latest situation of each node and each link. If
there are changes in any point in the network (a link is down, for example), the topology must
be updated for each node.
Building Routing Tables
In link state routing, four sets of actions are required to ensure that each node has the routing
table showing the least-cost node to every other node.
1. Creation of the states of the links by each node, called the link state packet or LSP.
2. Distribution of LSPs to every other router, called flooding, in an efficient and reliable way.
3. Formation of a shortest path tree for each node.
4. Calculation of a routing table based on the shortest path tree.
3.2.5 Path Vector Routing
Path vector routing is exterior routing protocol proved to be useful for interdomain
or inter-AS routing. In distance vector routing, a router has a list of networks that can be
reached in the same AS with the corresponding cost (number of hops). In path vector routing,
a router has a list of networks that can be reached with the path (list of ASs to pass) to reach
each one. In other words, the domain of operation of the distance vector routing is a single
AS; the domain of operation of the path vector routing is the whole Internet. The distance
vector routing tells us the distance to each network; the path vector routing tells us the path.
3.3 Unicast Routing Protocols:
3.3.1 Internet Structure
The Internet has changed from a tree-like structure, with a single back bone, to a multi-
backbone structure run by different private corporations today. Although it is difficult to give
a general view of the Internet today, the Internet structure similar as shown in Figure.
There are several backbones run by private communication companies that provide global
connectivity. These backbones are connected by some peering points that allow connectivity
between backbones. At a lower level, there are some provider networks that use the
backbones for global connectivity but provide services to Internet customers.

Figure: Internet structure


Finally, there are some customer networks that use the services provided by the provider
networks. Any of these three entities (backbone, provider network, or customer network) can
be called an Internet Service Provider or ISP. They provide services, but at different levels.

3.3.2 Routing Information Protocol (RIP)


The Routing Information Protocol (RIP) is an intradomain (interior) routing protocol
used inside an autonomous system. It is a very simple protocol based on distance vector
routing. RIP implements distance vector routing directly with some considerations:
1. In an autonomous system, we are dealing with routers and networks (links), what was
described as a node.
2. The destination in a routing table is a network, which means the first column defines a
network address.
3. The metric used by RIP is very simple; the distance is defined as the number of links
(networks) that have to be used to reach the destination. For this reason, the metric in RIP is
called a hop count.
4. Infinity is defined as 16, which means that any route in an autonomous system using RIP
cannot have more than 15 hops.
5. The next node column defines the address of the router to which the packet is to be sent to
reach its destination.
Example of a domain using RIP
Figure shows an autonomous system with seven networks and four routers. The table of each
router is also shown. Let us look at the routing table for R1. The table has seven entries to
show how to reach each network in the autonomous system. Router R1 is directly connected
to networks 130.10.0.0 and 130.11.0.0, which means that there are no next hop entries for
these two networks. To send a packet to one of the three networks at the far left, router R1
needs to deliver the packet to R2. The next node entry for these three networks is the
interface of router R2 with IP address 130.10.0.1. To send a packet to the two networks at the
far right, router R1 needs to send the packet to the interface of router R4 with IP address
130.11.0.1.

Figure: Example of a domain using RIP

RIP Message Format


The format of the RIP message is shown in Figure.

Figure: RIP message format


 Command. This 8-bit field specifies the type of message: request (1) or response (2).
 Version. This 8-bit field defines the version. In this book we use version 1, but at the
end of this section, we give some new features of version 2.
 Family. This 16-bit field defines the family of the protocol used. For TCP/IP the value
is 2.
 Network address. The address field defines the address of the destination network.
RIP has allocated 14 bytes for this field to be applicable to any protocol. However, IP
currently uses only 4 bytes. The rest of the address is filled with 0s.
 Distance. This 32-bit field defines the hop count (cost) from the advertising router to
the destination network.

Requests and Responses


RIP has two types of messages: request and response.
Request
A request message is sent by a router that has just come up or by a router that has some
time-out entries. A request can ask about specific entries or all entries.

Figure: Request messages


Response
A response can be either solicited or unsolicited. A solicited response is sent only in answer
to a request. It contains information about the destination specified in the corresponding
request. An unsolicited response, on the other hand, is sent periodically, every 30 seconds or
when there is a change in the routing table. The response is sometimes called an update
packet. Figure shows the response message format.

Figure: Response message format

Timers in RIP
RIP uses three timers to support its operation. The periodic timer controls the sending of
messages, the expiration timer governs the validity of a route, and the garbage collection
timer advertises the failure of a route.

1 Periodic Timer
The periodic timer controls the advertising of regular update messages. Although the protocol
specifies that this timer must be set to 30 s, the working model uses a random number
between 25 and 35 s. This is to prevent any possible synchronization and therefore overload
on an internet if routers update simultaneously.
Each router has one periodic timer that is randomly set to a number between 25 and 35. It
counts down; when zero is reached, the update message is sent, and the timer is randomly set
once again.
2 Expiration Timer
The expiration timer governs the validity of a route. When a router receives update
information for a route, the expiration timer is set to 180 s for that particular route. Every
time a new update for the route is received, the timer is reset. In normal situations this occurs
every 30 s. However, if there is a problem on an internet and no update is received within the
allotted 180 s, the route is considered expired and the hop count of the route is set to 16,
which means the destination is unreachable. Every route has its own expiration timer.
3 Garbage Collection Timer
When the information about a route becomes invalid, the router does not immediately purge
that route from its table. Instead, it continues to advertise the route with a metric value of 16.
At the same time, a timer called the garbage collection timer is set to 120s for that route.
When the count reaches zero, the route is purged from the table. This timer allows neighbours
to become aware of the invalidity of a route prior to purging.

3.3.3 Open Shortest Path First (OSPF)


Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks. It
uses a link state routing (LSR) algorithm and falls into the group of interior gateway
protocols (IGPs), operating within a single autonomous system (AS). It is defined as OSPF
Version 2 in (1998) for IPv4. The updates for IPv6 are specified as OSPF Version 3 in
(2008). OSPF supports the Classless Inter-Domain Routing (CIDR) addressing model.
A Areas
To handle routing efficiently and in a timely manner, OSPF divides an autonomous system
into areas. An area is a collection of networks, hosts, and routers all contained within an
autonomous system. An autonomous system can be divided into many different areas. All
networks inside an area must be connected.
Routers inside an area flood the area with routing information. At the border of an area,
special routers called area border routers summarize the information about the area and send
it to other areas. Among the areas inside an autonomous system is a special area called the
backbone; all of the areas inside an autonomous system must be connected to the backbone.
This does not mean that the routers within areas cannot be connected to each other, however.
The routers inside the backbone are called the backbone routers.
If, because of some problem, the connectivity between a backbone and an area is broken, a
virtual link between routers must be created by the administration to allow continuity of the
functions of the backbone as the primary area.
Each area has an area identification. The area identification of the backbone is zero. Figure
shows an autonomous system and its areas.
Figure: Areas in an autonomous system

B Metric
The OSPF protocol allows the administrator to assign a cost, called the metric, to each route.
The metric can be based on a type of service (minimum delay, maximum throughput, and so
on). As a matter of fact, a router can have multiple routing tables, each based on a different
type of service.
C Types of Links
In OSPF terminology, a connection is called a link. Four types of links have been defined:
point-to-point, transient, stub, and virtual (see Figure).

1 Point-to-Point Link
A point-to-point link connects two routers without any other host or router in between. In
other words, the purpose of the link (network) is just to connect the two routers. An example
of this type of link is two routers connected by a telephone line or a T-line.
2 Transient Link
A transient link is a network with several routers attached to it. The data can enter
through any of the routers and leave through any router. All LANs and some WANs with
two or more routers are of this type.
3 Stub Link
A stub link is a network that is connected to only one router. The data packets enter the
network through this single router and leave the network through this same router. This is a
special case of the transient network.
4 Virtual Link
When the link between two routers is broken, the administration may create a virtual
link between them using a longer path that probably goes through several routers.

D OSPF Packets
OSPF uses five different types of packets: hello, database description, link state
request, link state update, and link state acknowledgment (see Figure). The link state update
has five different kinds.
Figure: Types of OSPF packets
Hello—Establishes and maintains neighbour relationships.
Database description—Describes the contents of the topological database. These messages
are exchanged when an adjacency is initialized.
Link-state request—Requests pieces of the topological database from neighbour routers.
These messages are exchanged after a router discovers (by examining database-description
packets) that parts of its topological database are outdated.
Link-state update—Responds to a link-state request packet. These messages also are used
for the regular dispersal of LSAs. Several LSAs can be included within a single link-state
update packet.
Link-state acknowledgment—Acknowledges link-state updates packets

E Common Header
All OSPF packets have the same common header. As shown in figure.
❑ Version. This 8-bit field defines the version of the OSPF protocol. It is currently version 2.
❑ Type. This 8-bit field defines the type of the packet. As we said before, we have five types,
with values 1 to 5 defining the types.
❑ Message length. This 16-bit field defines the length of the total message including the
header.

Figure: OSPF common header


❑ Source router IP address. This 32-bit field defines the IP address of the router that sends
the packet.
❑ Area identification. This 32-bit field defines the area within which the routing takes place.
❑ Checksum. This field is used for error detection on the entire packet excluding the
authentication type and authentication data field.
❑ Authentication type. This 16-bit field defines the authentication protocol used in this area.
At this time, two types of authentication are defined: 0 for none and 1 for password.
❑ Authentication. This 64-bit field is the actual value of the authentication data. In the future,
when more authentication types are defined, this field will contain the result of the
authentication calculation. For now, if the authentication type is 0, this field is filled with 0s.
If the type is
1, this field carries an eight-character password.

3.3.4 Border Gateway Protocol Version 4 (BGP4).


The Border Gateway Protocol version 4 (BGP4) is the only interdomain routing protocol
used in the Internet. BGP4 is based on the path-vector algorithm. BGP4 is a complex
protocol.
Figure shows an example of an internet with four autonomous systems. AS2, AS3, and AS4
are stub autonomous systems; AS1 is a transient one. In example, data exchange between
AS2, AS3, and AS4 should pass through AS1.
Each autonomous system in this figure uses one of the two common intradomain protocols,
RIP or OSPF. Each router in each AS knows how to reach a network that is in its own AS,
but it does not know how to reach a network in another AS.
To enable each router to route a packet to any network in the internet, first install a variation
of BGP4, called external BGP (eBGP), on each border router (the one at the edge of each AS
which is connected to a router at another AS). Then install the second variation of BGP,
called internal BGP (iBGP), on all routers. This means that the border routers will be running
three routing protocols (intradomain, eBGP, and iBGP), but other routers are running two
protocols (intradomain and iBGP).

Figure: A sample internet with four ASs

3.4 Introduction:
3.4.1 Unicast
In unicasting, there is one source and one destination network. The relationship between the
source and the destination network is one to one. Each router in the path of the datagram tries
to forward the packet to one and only one of its interfaces.
Figure shows a small internet in which a unicast packet needs to be delivered from a source
computer to a destination computer attached to N6. Router R1 is responsible for forwarding
the packet only through interface 3; router R4 is responsible for forwarding the packet only
through interface 2. When the packet arrives at N6, the delivery to the destination host is the
responsibility of the network; it is either broadcast to all hosts or the Ethernet switch delivers
it only to the destination host.
Figure: Unicasting
3.4.2 Multicast
In multicasting, there is one source and a group of destinations. The relationship is one to
many. In this type of communication, the source address is a unicast address, but the
destination address is a group address, a group of one or more destination networks in which
there is at least one member of the group that is interested in receiving the multicast
datagram. The group address defines the members of the group. Figure shows the same small
internet, but the unicast routers have been changed to multicast routers.

Figure: Multicasting
In multicasting, a multicast router may have to send out copies of the same datagram through
more than one interface. In Figure 21.2, router R1 needs to send out the datagram through
interfaces 2 and 3. Similarly, router R4 needs to send out the datagram through both its
interfaces. Router R3, however, knows that there is no member belonging to this group in the
area reached by interface 2; it only sends out the datagram through interface 1.
3.4.3 Broadcast.
In broadcast communication, the relationship between the source and the destination is one to
all. There is only one source, but all of the other hosts are the destinations. The Internet does
not explicitly support broadcasting because of the huge amount of traffic it would create and
because of the bandwidth it would need. Imagine the traffic generated in the Internet if one
person wanted to send a message to everyone else connected to the Internet.

You might also like