0% found this document useful (0 votes)
4 views46 pages

Chapter 3 and 4

Chapter 3 discusses the transport layer, which is responsible for providing communication services to application processes across different hosts, primarily through protocols like TCP and UDP. It outlines key services such as end-to-end delivery, reliable delivery, flow control, and multiplexing/demultiplexing, as well as the differences between connection-oriented and connectionless services. The chapter also details the features and functionalities of TCP and UDP, emphasizing their roles in ensuring data integrity and transmission efficiency.

Uploaded by

yonasdesalegn829
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views46 pages

Chapter 3 and 4

Chapter 3 discusses the transport layer, which is responsible for providing communication services to application processes across different hosts, primarily through protocols like TCP and UDP. It outlines key services such as end-to-end delivery, reliable delivery, flow control, and multiplexing/demultiplexing, as well as the differences between connection-oriented and connectionless services. The chapter also details the features and functionalities of TCP and UDP, emphasizing their roles in ensuring data integrity and transmission efficiency.

Uploaded by

yonasdesalegn829
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 3

Transport Layer

The transport layer is a 4th layer from the top.

o Transport layer is used to provide the communication services directly to the application

processes running on different hosts. The transport layer provides a logical communication

between application processes running on different hosts. The transport layer protocols

are implemented in the end systems but not in the network routers. TCP and UDP are two

transport layer protocols that provide a different set of services to the network layer. All

transport layer protocols provide multiplexing/demultiplexing service. According to the

layered model, the transport layer interacts with the functions of the session layer. Many

protocols combine session, presentation, and application layer protocols into a single

layer known as the application layer. In these cases, delivery to the session layer means

the delivery to the application layer. Data generated by an application on one machine

must be transmitted to the correct application on another machine.

The services provided by the transport layer protocols can be divided into five

categories:

1. End-to-end delivery

2. Addressing

3. Reliable delivery

4. Flow control

5. Multiplexing

End-to-end Delivery:

• The transport layer transmits the entire message to the destination. To ensures the

end-to-end delivery of an entire message from a source to the destination.


Reliable delivery:

• The transport layer provides reliability services by retransmitting the lost and

damaged packets.

Error Control

The data link layer also provides the error handling mechanism, but it ensures only node-

tonode error-free delivery. However, node-to-node reliability does not ensure the end-to-

end reliability. The data link layer checks for the error between each network. If an error is

introduced inside one of the routers, then this error will not be caught by the data link layer.

Data link layer only detects those errors that have been introduced between the beginning

and end of the link. Therefore, the transport layer performs the checking for the errors end-

to-end to ensure that the packet has arrived correctly.

Sequence control

On the sending end, the transport layer is responsible for ensuring that the packets received

from the upper layers can be used by the lower layers. On the receiving end, it ensures that

the various segments of a transmission can be correctly reassembled.

Loss control

The transport layer ensures that all the fragments of a transmission arrive at the destination,

not some of them. On the sending end, all the fragments of transmission are given sequence

numbers by a transport layer. The sequence numbers allow to identify the missing segment.
Duplication control

The transport layer guarantees that no duplicate data arrive at the destination. Sequence

numbers are used to identify the lost packets; similarly, it allows the receiver to identify and

discard duplicate segments.

Flow control

Flow control is used to prevent the sender from overwhelming the receiver.

If the receiver is overloaded with too much data, then the receiver discards the packets and asking

for the retransmission of packets. This increases network congestion and thus, reducing the system

performance. The transport layer is responsible for flow control. It uses the sliding window

protocol that makes the data transmission more efficient as well as it controls the flow of data so

that the receiver does not become overwhelmed. Sliding window protocol is byte oriented rather

than frame oriented.

Addressing

Whenever we need to deliver something to one specific destination among many, we need

an address. At the data link layer, we need a MAC address to choose one node among several

nodes if the connection is not point-to-point. A frame in the data link layer needs a

destination MAC address for delivery and a source address for the next node's reply. At the

network layer, we need an IP address to choose one host among millions. A datagram in the

network layer needs a destination IP address for delivery and a source IP address for the

destination's reply. At the transport layer, we need a transport layer address, called a port

number, to choose among multiple processes running on the destination host. A port

number is a 16-bit number, ranging from 0 to 65536, assigned to an application process for

identification on the Internet. Some port numbers are reserved for popular Internet

application. For example, port 80 is reserved for the Web Server. Whenever a new Internet

application is developed, a port number must be assigned to it. The destination port number

is needed for delivery; the source port number is needed for the replay. Ports are the essential
ways to address multiple entities in the same location. Using port addressing it is possible to

use more than one network-based application at the same time.

Three types of Port numbers are used:

Well-known ports - These are permanent port numbers. They range between 0 to [Link]

port numbers are used by Server Process.

Registered ports - The ports ranging from 1024 to 49,151 are not assigned or controlled.

Ephemeral ports (Dynamic Ports) – These are temporary port numbers. They range between

49152–[Link] ports numbers are used by Client Process.

The transport layer protocols need to know which upper-layer protocols are communicating.

Multiplexing and Demultiplexing:

The addressing mechanism allows multiplexing and demultiplexing by the transport layer.

Multiplexing:

Whenever an entity accepts items from more than one source, this is referred to as

multiplexing (many to one). At the sender side, there may be several processes that need to

send packets. However, there is only one transport layer protocol at any time. This is a many-

to-one relationship and requires multiplexing. The protocol accepts messages from different

processes, differentiated by their assigned port numbers. After adding the header, the

transport layer passes the packet to the network layer.

Demultiplexing:

Whenever an entity delivers items to more than one source, this is referred to as

demultiplexing (one to many).At the receiver site, the relationship is one-to-many and

requires demultiplexing. The transport layer receives datagrams from the network layer.
After error checking and dropping of the header, the transport layer delivers each message

to the appropriate process based on the port number.

Connectionless And Connection-oriented

Data communication is a telecommunication network to send and receive data between two

or more computers over the same or different network. There are two ways to establish a

connection before sending data from one device to another.

1. Connection-oriented

2. connectionless service

Connection-oriented service

A connection-oriented service is a network service that was designed and developed

after the telephone system. A connection-oriented service is used to create an end to end

connection between the sender and the receiver before transmitting the data over the

same or different networks. In connection-oriented service, packets are transmitted to the

receiver in the same order as the sender has sent them. It uses a handshake method that

creates a connection between the receiver and sender for transmitting the data over the

network. Hence it is also known as a reliable network service there is a sequence of

operations to be followed by connection-oriented service. These are:

1. The connection is established.

2. Information is sent.

3. The connection is released.

In connection-oriented service, we have to establish a connection before starting the

communication. When the connection is established, we send the message or the

information and then we release the connection. Connection-oriented service is more


reliable than connectionless service. We can send the message in a connection-oriented

service if there is an error at the receiver's end. An example of connection-oriented is TCP

(Transmission Control Protocol) protocol.

Handshaking over a network is commonly called a 3-way handshake or "syn-syn-ack."

a successful handshake involves the following steps:

Step 1: A connection between server and client is established

Step 2: the server receives the SYN packet from the client node

Step 3: client node receives the SYN/ACK from the server and responds with an ACK

packet

When a system initiates a handshake, there are three possible outcomes:

1. No response : if the system receiving the handshake is not available or does not

support the protocol the initiating system uses, it may not respond to the request.

2. Connection refused : the system receiving the handshake is available and

understands the request, but denies the connection.

3. Connection accepted : the system receiving the handshake is available, receives the

request, and accepts the connection.

Advantages of connection-oriented services

This is mostly a reliable connection.

Congestions( a situation in which a place is too blocked or crowded) are less frequent.

Sequencing of data packets is guaranteed. Problems related to duplicate data packets are

alleviated. Suitable for long connection.

Disadvantages of connection-oriented services


Resource allocation is needed before communication. This often leads to under-utilized

network resources. In the case of router failures or network congestions, there are no

alternative ways to continue communication. The lesser speed of connection due to the

time is taken for establishing and relinquishing the connection. This allocation of

resources is mandatory before communication.

Connectionless Service

Connectionless service is used in the network system to transfer data from one end to

another end without creating any connection. It is not a reliable network service because

it does not guarantee the transfer of data packets to the receiver, and data packets can be

received in any order to the receiver. Therefore we can say that the data packet does not

follow a defined path.

Reliable vs. unreliable communication

Reliable

 End stations running reliable protocols will work together to verify the transmission

of data to ensure accuracy and integrity of the data. A reliable system will set up a

connection and verify that all data transmitted is controlled in an orderly fashion, is

received in the correct order. TCP guarantees accurate and complete delivery of data

packets by retransmitting lost packets and ensuring data integrity. Transmission

control protocol (TCP) is a typical reliable protocol.

Unreliable

 Unreliable protocols make no effort to set up a connection, they don't check to see if

the data was received and usually don't make any provisions for recovering from

errors or lost data. User datagram protocol (UDP) is an example of an unreliable

protocol.
Transport Layer protocols

The transport layer is represented by two protocols:

1. TCP (Transmission Control Protocol)

2. UDP(User Datagram Protocol)

UDP Protocol

 User datagram protocol (UDP) is a transport layer protocol. Unlike TCP, it is an

unreliable and connectionless protocol. So, there is no need to establish a connection

prior to data transfer. UDP enables the process to process communication, whereas

the TCP provides host to host communication. Since UDP sends the messages in the

form of datagrams, it is considered the best-effort mode of communication. TCP

sends the individual packets, so it is a reliable transport medium.

Features of UDP protocol

 UDP is the simplest transport layer communication protocol.

UDP provides no acknowledgment mechanism: which means that the receiver does not

send the acknowledgment for the received packet, and the sender also does not wait for

the acknowledgment for the packet that it has sent.

Connectionless: The UDP is a connectionless protocol as it does not create a virtual path

to transfer the data. It does not use the virtual path, so packets are sent in different paths

between the sender and the receiver, which leads to the loss of packets or received out of

order.

Segments are handled independently: Each UDP segment is handled individually of

others as each segment takes different path to reach the destination.


Faster transmission: UDP enables faster transmission as it is a connectionless protocol, i.E.,

No virtual path is required to transfer the data. But there is a chance that the individual

packet is lost, which affects the transmission quality

Acknowledgment mechanism : It neither takes the acknowledgement, nor it retransmits

the damaged frame.

Stateless : It is a stateless protocol that means that the sender does not get the

acknowledgement for the packet which has been sent.

UDP Header Format

 Source port number: it is 16-bit information that identifies which port is going to send

the packet.

 Destination port number: it identifies which port is going to accept the information.

It is 16-bit information which is used to identify application-level service on the

destination machine.

 Length: it is 16-bit field that specifies the entire length of the UDP packet that includes

the header also.

 Checksum: it is a 16-bits field, and it is an optional field. This checksum field checks

whether the information is accurate or not.


When to use UDP?

1. Reduce the requirement of computer resources.

2. When using the multicast or broadcast to transfer.

3. The transmission of real-time packets, mainly in multimedia applications.

4. UDP is used for some routing update protocols like RIP (routing information

protocol).

5. Used for simple request response communication when size of data is less.

TCP

 TCP stands for transmission control protocol. It provides full transport layer services

to applications. It is a connection-oriented protocol means the connection established

between both the ends of the transmission. The main functionality of the TCP is to

take the data from the application/session layer. Then it divides the data into a several

packets, provides numbering to these packets, and finally transmits these packets to

the destination. If we want the communication between two computers and

communication should be good and reliable. For example, we want to view a web

page, then we expect that nothing should be missing on the page, or we want to

download a file, then we require a complete file, i.e., Nothing should be missing either

it could be a text or an image. This can only be possible due to the TCP.

Features of TCP protocol

Transport layer protocol: TCP is a transport layer protocol as it is used in transmitting the

data from the sender to the receiver.


Stream data transfer: TCP protocol transfers the data in the form of contiguous stream

of bytes. TCP group the bytes in the form of TCP segments and then passed it to the IP

layer for transmission to the destination.

Data delivery: TCP protocol ensures that the data is received correctly, no data is missing

and in order. If TCP protocol is not used, then the incorrect data can be received or out

of order.

Connection-oriented: It is a connection-oriented service that means the data exchange

occurs only after the connection establishment. When the data transfer is completed, then

the connection will get terminated.

o Establish a connection between two TCPs.

o Data is exchange in both the directions.

o The connection is terminated.

Protocol : TCP is a connection-oriented protocol. This is done by using a three-way

handshake. In a three-way handshake, the first sender sends the syn message to the

receiver then the receiver sends back the syn ack message to confirm that the message has

been received. After receiving the syn ack message, the sender sends the

acknowledgment message to the receiver. In this way, the connection is established

between the computers.


Order of the data is maintained: This protocol ensures that the data reaches the

intended receiver in the same order in which it is sent. It orders and numbers each

segment so that the TCP layer on the destination side can reassemble them based on

their ordering.

Reliability: TCP assigns a sequence number to each byte transmitted and expects a

positive acknowledgement from the receiving TCP. If ack is not received within a

timeout interval, then the data is retransmitted to the destination. The receiving TCP

uses the sequence number to reassemble the segments if they arrive out of order or to

eliminate the duplicate segments.

Flow control

When receiving TCP sends an acknowledgement back to the sender indicating the

number the bytes it can receive without overflowing its internal buffer. The number of

bytes is sent in ack in the form of the highest sequence number that it can receive without

any problem. This mechanism is also referred to as a window mechanism.

TCP Segment Format

Where,

 Source port address: it is used to define the address of the application program in a

source computer. It is a 16-bit field.


 Destination port address: it is used to define the address of the application program

in a destination computer. It is a 16-bit field.

 Sequence number: a stream of data is divided into two or more tcp segments. The

32-bit sequence number field represents the position of the data in an original data

stream.

 Acknowledgement number: a 32-field acknowledgement number acknowledge the

data from other communicating devices. If ack field is set to 1, then it specifies the

sequence number that the receiver is expecting to receive.

 Header length (hlen): it specifies the size of the tcp header in 32-bit words. The

minimum size of the header is 5 words, and the maximum size of the header is 15

words. Therefore, the maximum size of the tcp header is 60 bytes, and the minimum

size of the tcp header is 20 bytes.

 Reserved: it is a six-bit field which is reserved for future use.

There are total six types of flags in control field:

 Urg: the urg field indicates that the data in a segment is urgent.

 Ack: when ack field is set, then it validates the acknowledgement number.

 psh: the psh field is used to inform the sender that higher throughput is needed so

if possible, data must be pushed with higher throughput.

 Rst: the reset bit is used to reset the TCP connection when there is any confusion

occurs in the sequence numbers.

 Syn: the syn field is used to synchronize the sequence numbers in three types of

segments: connection request, connection confirmation (with the ack bit set), and

confirmation acknowledgement.
 Fin: the fin field is used to inform the receiving TCP module that the sender has

finished sending data. it is used in connection termination in three types of

segments: termination request, termination confirmation, and acknowledgement of

termination confirmation.

 Window size: the window is a 16-bit field that defines the size of the window.

 Checksum: the checksum is a 16-bit field used in error detection.

 Urgent pointer: if urg flag is set to 1, then this 16-bit field is an offset from the

sequence number indicating that it is a last urgent data byte.

 Options and padding: it defines the optional fields that convey the additional

information to the receiver.


Chapter 4

Network Layer Addressing and Routing

The Network Layer is the OSI model’s third layer. It responds to service requests from

the transport layer and sends them to the data link layer. It decides the path from the

source to the destination and manages issues such as switching, routing, and data packet

congestion. The network layer’s primary function is to transport packets from the sending

host to the receiving host.

The services which are offered by the network layer protocol are: Packetizing,

Fragmentation, Network Addressing/ Logical Addressing, Routing, and Forwarding.

What is a packet?

As network consist of a large number of machines, where all of them are in

communication with each other. In the case of communication, large number of data is

present on medium all the time. In order to transmit this data accurately and in a way

that medium do not get rash, it is divided into small packets (chunks of data). This process
is called Packetizing. Example of Packets: Suppose you are sending an image to another

computer/friend using internet. Your image will be divided in chunks of packets and will

transmitted to your friend’s computer.

Packetizing

Packetizing is a process of dividing long messages into smaller ones. The process of

encapsulating the data received from upper layers of the network (also called as payload) in

a network layer packet at the source and decapsulating the payload from the network layer

packet at the destination is known as packetizing.

Routing and Forwarding

In a network, there are a number of routes available from the source to the destination. The

network layer specifies has some strategies which find out the best possible route. This

process is referred to as routing. Forwarding is simply defined as the action applied by each

router when a packet arrives at one of its interfaces. When a router receives a packet from

one of its attached networks, it needs to forward the packet to another attached network

(unicast routing) or to some attached networks (in case of multicast routing).

Fragmentation:

Fragmentation occurs at the network layer (Layer 3) of the OSI model. It is the process of

breaking down large IP packets into smaller fragments to fit within the maximum

transmission unit (MTU) size of the network. The aim of fragmentation is that prevent

dropping of packets when travelling through networks that has different MTUs.

Fragmentation is necessary when a packet is too large to traverse a network without being

fragmented by intermediate devices, such as routers, that have smaller MTU sizes on their

outgoing interfaces. When a packet is fragmented, each fragment is treated as a separate

packet and includes a fragment offset field to indicate its position within the original packet.
Network Addressing/ Logical Addressing:

A network address is any logical address that uniquely distinguishes a network node or

device over a computer or telecommunications network. The physical addressing is

implemented by the data connection layer, while the logical addressing is implemented by

the network layer. Logical addressing is also utilized to distinguish between a system’s

source and destination. The network layer appends a header to the packet that contains the

logical addresses of the sender and recipient. It is a numeric/symbolic number or address

that is assigned to any device that seeks access to or is part of a network. A router is different

from host in that it has two or more links that connect to it. The boundary between the router

and link is known as an interface, and the router can have multiple interfaces, one for each

of its links. Each interface is capable of sending and receiving the IP packets, so IP requires

each interface to have an address.

IP Addressing

To uniquely identify each computer or networking device in the network, computer

networks also use addresses. Addresses in computer networks are known as IP addresses.

An IP address consists of two components: the network address and the host address. The

network address is used to find the subnet in which the computer or the device is located.

The host address is used to find the computer or the device in the subnet. If a large

computer network is divided into smaller groups, each group is known as a subnet.
In the above figure, a router has three interfaces labeled as 1, 2 & 3 and each router

interface contains its own IP address. Each host contains its own interface and IP address.

All the interfaces attached to the LAN 1, LAN2, and LAN3 is having an IP address in the

form of [Link], [Link] and [Link] respectively. Each IP address consists of

two parts. The first part (first three bytes in IP address) specifies the network and second

part (last byte of an IP address) specifies the host in the network. IP addresses can be

written in different notations: binary, dotted-decimal, and hexadecimal. Binary notation

is complex to write and understand. To make IP addresses human friendly, IP addresses

are also written in dotted-decimal and hexadecimal notations. If IP addresses are written

in dotted-decimal notation or hexadecimal notation, computers automatically convert

them into binary notation before processing them.

There are two versions of IP addresses:

1. IPv4

2. IPv6.

The length of IP addresses is different in both versions. Both versions also use different

formats to differentiate between network addresses and host addresses.


IPv4

 An IPv4 address is 32 bits long. The IPv4 addresses are unique and universal.

IPv4 Address Notations

There are two prevalent notations to show an IPv4

address:

a. Binary notation and

b. Dotted decimal notation.

Binary Notation

 In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often

referred to as a byte.

Dotted-Decimal Notation

 To make the IPv4 address more compact and easier to read, Internet addresses are

usually written in decimal form with a decimal point (dot) separating the bytes.
Find the error, if any, in the following IPv4 addresses:

a. [Link]

b. [Link].20

c. [Link]

d. 11100010.23.14.67

Solution

a. There should be no leading zeroes (045).

b. We may not have more than 4 bytes in an IPv4 address.

c. Each byte should be less than or equal to 255.

d. A mixture of binary notation and dotted-decimal notation.

Change the following IPv4 addresses from binary notation to dotted-decimal notation.

Solution

Change the following IPv4 addresses from dotted-decimal notation to binary

notation. a. [Link]

b. [Link]

We replace each decimal number with its binary equivalent


Subnetting

• Subnetting is dividing a network into two or more smaller networks. . It increases

routing efficiency, enhances the security of the network and reduces the size of the

broadcast domain.

• There are two parts in an IP Address. One for them is Network part and the Host part.

With IP Subnetting, we are adding one more part. This is “Subnet Part”. From the

Host part, we borrow some bits and we will use this part for Subnet

There are two types of IPv4 addressing schemes:

 Classful Addressing

 Classless Addressing

Classful Addressing

 Classful addressing is an IPv4 addressing architecture that divides addresses into five

groups.

 Classful addressing divides the IPv4 address space ([Link]-[Link]) into 5

classes: A, B, C, D, and E.

 However, only A, B, and C are used for network hosts.


 Class D, which covers the [Link]-[Link] IP address range, is reserved for

multicasting, and class E ([Link]-[Link]) is reserved for “future use.”


Example : Find the class of each address.

a. 00000001 00001011 00001011 11101111

b. 11000001 10000011 00011011 11111111

c. [Link]

d. [Link]

Solution

a. The first bit is 0. This is a class A address.

b. The first 2 bits are 1; the third bit is 0. This is a class C address.

c. The first byte is 14 (between 0 and 127); the class is A.

d. The first byte is 252 (between 240 and 255); the class is E.

Netid and Hostid

 In classful addressing, an IP address in class A, B, or C is divided into netid and

hostid. These parts are of varying lengths, depending on the class of the address.

Note that the concept does not apply to classes D and E.

 In class A, 1byte defines the netid and 3 bytes define the hostid.

 In class B, 2 bytes define the netid and 2 bytes define the hostid.

 In class C, 3 bytes define the netid and 1 byte defines the hostid.
Class Binary Dotted decimal CIDR

A 11111111 00000000 00000000 00000000 [Link] /8

B 11111111 11111111 00000000 00000000 [Link] /16

C 11111111 11111111 11111111 00000000 [Link] /24

Subnet Mask

 A mask (also called the default mask) is a 32-bit number made of contiguous 1’s

followed by contiguous 0’s.

 The mask can help us to find the netid and the hostid.

 The last column of table shows the mask in the form /n where n can be 8, 16, or 24 in

classful addressing.

 This notation is also called slash notation.

Address Depletion Problem

 The fast growth of the Internet led to the near running down of the available addresses

in classful addressing scheme. Yet the number of devices on the Internet is much less

than the 2 the power of 32 address space. We have run out of class A and B addresses,

and a class C block is too small for most midsize organizations. One solution that has

eased the problem is the idea of classless addressing. Classful addressing, which is

almost outdated, is replaced with classless addressing.


Mask

• In IPv4 addressing, a block of addresses can be defined as x.y.z.t/n in which x.y.z.t

defines one of the addresses and the /n defines the mask.

• The address and the /n notation completely define the whole block (the first address,

the last address, and the number of addresses).

The Internet authorities impose 3 restrictions on classless address blocks:

1. The addresses in a block must be contiguous, one after another.

2. The number of addresses in a block must be a power of 2 (1, 2, 4, 8, ... ).

3. The first address must be evenly divisible by the number of addresses. Example

Figure shows a block of addresses, in both binary and dotted-decimal notation, granted

to a small business that needs 16 addresses. The addresses are contiguous.

 The number of addresses is a power of 2 (16 = 2 the power of 4 ), and the first address is

divisible by 16.

 The first address, when converted to a decimal number, is 3,440,387,360, which when

divided by 16 results in 215,024,210.

 First Address: The first address in the block can be found by setting the 32 - n

rightmost bits in the binary notation of the address to 0’s


 Last Address: The last address in the block can be found by setting the 32 - n rightmost

bits in the binary notation of the address to 1’s.

Example: A block of addresses is granted to a small organization. We know that one of

the addresses is [Link]/28. What is the first and last address in the block?

Solution

1. The binary representation of the given address is 11001101 00010000 00100101

00100111

2. If we set 32 - 28 rightmost bits to 0, we get first address 11001101 0001000 00100101

0010000 or [Link].

3. If we set 32 - 28 rightmost bits to 1, we get Last address

11001101 00010000 00100101 0010 1111 or [Link].

• The first address in a block is normally not assigned to any device. It is used as the

network address that represents the organization to the rest of the world.

Limitations of Classful Addressing:

 A block in class A address is too large for almost any organization. This means most

of the addresses in class A were wasted and were not used.

 A block in class B is also very large, probably too large for many of the organizations

that received a class B block.

 A block in class C is probably too small for many organizations.

 Class D addresses were designed for multicasting. Each address in this class is used

to define one group of hosts on the Internet. The Internet authorities wrongly
predicted a need for 268,435,456 groups. This never happened and many addresses

were wasted here too.

 And lastly, the class E addresses were reserved for future use; only a few were used,

resulting in another waste of addresses.

Number of subnet= 2n , where n is the number of borrowed bit

Total number of ip address =2n , where n is the number of host bit

Total number of usable ip address =2n-2 , where n is the number of host bit

Example

The correct default subnet mask of the following addresses:

[Link] [Link]

[Link] [Link]

[Link] [Link]

[Link] [Link]

Example

Represent /26 in dotted decimal format.

[Link]

Example

How many hosts can be located on a network, where the IPv4 netmask is 27 bits?

Number of host=2n-2=32-2=30

Example

What are two ways to represent a network mask that would allow 14 hosts?
/28 or [Link]

Example

What subnet mask will allow for 128 hosts on a subnet?

[Link] or /24 Example

You have sub-netted your class C network [Link] with a subnet mask of

[Link]. Please list the following: number of networks, number of hosts per

network, the full range of the first three networks, and the usable address range from

those first three networks.

Number of networks/subnet = 16

Number of hosts = 14

Full Range for first three networks:

[Link]-[Link]

[Link]-[Link]

[Link]- [Link]

Usable Range for first three networks:

[Link]-[Link]

[Link]-[Link]

[Link]-[Link]

Example

You currently use the default mask for your IP network [Link]. You need to subnet

your network so that you have 30 additional networks, and 4 hosts per network. Is this

possible, and what subnet mask should you use?


Yes it is possible, using subnet mask [Link].

Example

You still are using the default mask for your IP network [Link]. You need to subnet

your network so that you have 5 additional networks, and 60 hosts per network. Is this

possible, and what subnet mask should you use?

No, it is not possible. Because since the given ip address falls into class C , the default

subnet mask is /24 which means we have only 8 bits for the host and if we use 6 bits for

our host(26=64-2=62, we can create enough hosts but the rest 2 bits can only create 4

subnet/network only) we have no enough bit. Example

You have sub-netted your class C network [Link] with a subnet mask of

[Link]. Please list the following: number of networks, number of hosts per

network, the full range of the first three networks, and the usable address range from

those first three networks. Additionally, identify the broadcast addresses for each

network.

Number of networks = 64

Number of hosts = 2

Full Range for first three networks:

[Link]-[Link]

[Link] -[Link]

[Link] - [Link]

Usable Range for first three networks: [Link]-2

[Link] - [Link]
[Link]-[Link]

Broadcast Addresses for first three networks:

[Link]

[Link]

[Link]

Example

Find the bits will be borrowed from the host to create 14 subnets and 14 hosts using the

ip address [Link].

Solution

From the given IP address we can understand that it belongs to class C address, this

implies that in class C address 24 bits are used for Network id and the rest 8 bits are used

for host id.

In subnetting the concept is dividing the host bit into subnet bit and host bit. So, based on

the given information we are going to create 14 hosts. To create 14 hosts to the minimum

we need 4 bits.

24-2=14, so by using only 4 bits we can create the required no of hosts.


Now if we use 4 bits to create hosts from 8 bits, the remaining bits will be 4 bits. So,

these bits are used as a subnet bit and by using this bits we can create 16

subnets/networks (24=16) Network Address Translation (NAT)

 NAT enables a user to have a large set of addresses internally and one address, or a

small set of addresses, externally. The traffic inside can use the large set; the traffic

outside, the small set. To separate the addresses used inside the home or business and

the ones used for the Internet, the Internet authorities have reserved 3 sets of

addresses as private addresses.

 Class A: [Link] to [Link]

 Class B: [Link] to [Link]

 Class C: [Link] to [Link]

 Everyone knows that these reserved addresses are for private networks.

 They are unique inside the organization, but they are not unique globally.

 No router will forward a packet that has one of these addresses as the destination

address.

 The site must have only one single connection to the global Internet through a router

that runs the NAT software.

NAT implementation
Address Translation

 All the outgoing packets go through the NAT router, which replaces the source

address in the packet with the global NAT address.

 All incoming packets also pass through the NAT router, which replaces the

destination address in the packet (the NAT router global address) with the

appropriate private address.

Port Address Translation – PAT

• Port Address Translation (PAT) is a feature of a network device that translates

communications made between hosts on a private network and hosts on a public

network.
• PAT is informally called router; gateway is more appropriate.

• In PAT, Private IP addresses are translated into the public IP address via Port

numbers. Address Mapping

 Logical to Physical Address Mapping –ARP

 Physical to Logical Address Mapping – RARP

Address mapping is a process of determining a logical address by knowing the physical

address of the device and determining the physical address by knowing the logical

address of the device. Address mapping is required when a packet is routed from source

host to destination host in the same or different network.


ARP Packet Format

Reverse Address Resolution Protocol (RARP)


ICMP

ICMP stands for Internet Control Message Protocol. It is a network layer protocol. It is

used for error handling in the network layer, and it is primarily used on network
devices such as routers. As different types of errors can exist in the network layer, so

ICMP can be used to report these errors and to debug those errors.

1. Error-reporting messages

The error-reporting message means that the router encounters a problem when it

processes an IP packet then it reports a message.

2. Query messages

The query messages are those messages that help the host to get the specific

information of another host. For example, suppose there are a client and a server, and

the client wants to know whether the server is live or not, then it sends the ICMP

message to the server.

ICMP Message Format

The message format has two things; one is a category that tells us which type of

message it is. If the message is of error type, the error message contains the type and
the code. The type defines the type of message while the code defines the subtype of

the message.

• Type: It is an 8-bit field. It defines the ICMP message type. The values range from 0 to

127 are defined for ICMPv6, and the values from 128 to 255 are the informational

messages.

• Code: It is an 8-bit field that defines the subtype of the ICMP message

• Checksum: It is a 16-bit field to detect whether the error exists in the message or not.

ICMPv6

• Another protocol that has been modified in version 6 of the TCPI/IP protocol suite is

ICMP (ICMPv6).

• This new version follows the same strategy and purposes of version 4. ICMPv4 has

been modified to make it more suitable for IPv6.

• In addition, some protocols that were independent in version 4 are now part of

Internetworking Control Message Protocol (ICMPv6). See compares the network

layer of version 4 to version 6.


• The ARP and IGMP protocols in version 4 are combined in ICMPv6. The RARP

protocol is dropped from the suite because it was rarely used and BOOTP has the

same functionality.

• The Bootstrap Protocol (BOOTP) is a computer networking protocol used in Internet

Protocol networks to automatically assign an IP address to network devices from a

configuration server.

• BOOTP is implemented using the User Datagram Protocol (UDP) for transport

protocol, port number 67 is used by the (DHCP) server for receiving client-requests

and port number 68 is used by the client for receiving (DHCP) server responses.

BOOTP operates only on IPv4 networks.

• Just as in ICMPv4, we divide the ICMP messages into two categories. However, each

category has more types of messages than before.

IGMP

• IGMP stands for Internet Group Message Protocol.

• The IP protocol supports two types of communication:

• Unicasting: It is a communication between one sender and one receiver. Therefore, we

can say that it is one-to-one communication.


• Multicasting: Sometimes the sender wants to send the same message to a large

number of receivers simultaneously. This process is known as multicasting which has

one-to-many communication.

• The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that

are the members of a group.

IGMP message

IGMP is a part of the IP layer, and IGMP has a fixed-size message. The IGMP message is

encapsulated within an IP datagram.

• Type: It determines the type of IGMP message. There are three types of IGMP

message: Membership Query, Membership Report and Leave Report.

• Maximum Response Time: This field is used only by the Membership Query message.

It determines the maximum time the host can send the Membership Report message

in response to the Membership Query message.

• Checksum: It determines the entire payload of the IP datagram in which IGMP

message is encapsulated.

Group Address: The behavior of this field depends on the type of the message sent.

• For Membership Query, the group address is set to zero for General Query and set to

the multicast group address for a specific query.


• For Membership Report and for Leave Group the group address is set to the multicast

group address.

Membership Query message

This message is sent by a router to all hosts on a local area network to determine the set

of all the multicast groups that have been joined by the host.

Membership Report message

The host responds to the membership query message with a membership report message.

The membership Query message sent by a router also includes a "Maximum Response

time”.

Leave Report: When the host does not send the "Membership Report message", it means

that the host has left the group.

IGMP operates locally. A multicast router connected to a network has a list of multicast

addresses of the groups with at least one loyal member in that network,
A host or multicast router can have membership in a group. When a host has

membership, it means that one of its processes (an application program) receives

multicast packets from some group. When a router has membership, it means that a

network connection to one of its other interfaces receives these multicast packets. There

are two other multicast routers (R1 and R2) that, depending on the group list maintained

by router R, could be the recipients of router R in this network. Routers RI and R2 may

be distributors for some of these groups in other networks but not on this network.

Joining a Group

A host or a router can join a group. A host maintains a list of processes that have

membership in a group. When a process wants to join a new group, it sends its request

to the host

Leaving a Group

When a host sees that no process is interested in a specific group, it sends a leave report.

Similarly, when a router sees that none of the networks connected to its interfaces is

interested in a specific group, it sends a leave report about that group.


Encapsulation

Encapsulation in networking is the process of adding headers and trailers around some

data. This is a fundamental concept used in the communication between different devices

over a network. During this process, each layer of the OSI (Open Systems

Interconnection) or TCP/IP (Transmission Control Protocol/Internet Protocol) model

wraps the data with its own header and trailer to provide relevant information for that

layer’s protocols. The IGMP message is encapsulated in an IP datagram, which is itself

encapsulated in a frame.

Netstat Utility

The netstat utility can be used to find the multicast addresses supported by an interface.

The netstat command generates displays that show network status and protocol statistics.

You can display the status of TCP and UDP endpoints in table format, routing table

information, and interface information. We use netstat with three options: -n, -r, and -a.

The -n option gives the numeric versions of IP addresses, the -r option gives the routing

table, and the -a option gives all addresses (unicast and multicast).

Routing algorithm

➢ In order to transfer the packets from source to the destination, the network layer must

determine the best route through which packets can be transmitted. The routing protocol

is a routing algorithm that provides the best path from the source to the destination. The
best path is the path that has the "least-cost path" from source to the destination. Routing

is the process of forwarding the packets from source to the destination but the best route

to send the packets is determined by the routing algorithm.

Classification of a Routing algorithm

The Routing algorithm is divided into two categories:

1. Adaptive Routing algorithm

2. Non-adaptive Routing algorithm

Adaptive Routing algorithm

An adaptive routing algorithm is also known as dynamic routing algorithm. This

algorithm makes the routing decisions based on the topology and network traffic. The

main parameters related to this algorithm are hop count, distance and estimated transit

time.

An adaptive routing algorithm can be classified into three parts:

Centralized algorithm: It is also known as global routing algorithm as it computes the

least-cost path between source and destination by using complete and global knowledge

about the network. Link state algorithm is referred to as a centralized.

Isolation algorithm: It is an algorithm that obtains the routing information by using local

information rather than gathering information from other nodes.

Distributed algorithm: It is also known as decentralized algorithm as it computes the

least-cost path between source and destination in an iterative and distributed manner.

Non-Adaptive Routing algorithm


Also known as static routing algorithm, do not change the selected routing decision for

transferring data packets from source to destination. They construct a static routing table

to determine the path.

The Non-Adaptive Routing algorithm is of two types:

Flooding: In case of flooding, every incoming packet is sent to all the outgoing links

except the one from it has been reached. The disadvantage of flooding is that node may

contain several copies of a particular packet.

Random walks: In case of random walks, a packet sent by the node to one of its neighbors

randomly. An advantage of using random walks is that it uses the alternative routes very

efficiently.

IPv6

What is IPv6?

• Internet Protocol Version 6 (IPv6) is the latest version of the Internet Protocol after

IPv4.

• Previous versions of IPv4 used a 32-bit addressing scheme to support 4.3 billion

devices.

• IPv6 uses a 128-bit address, which allows approximately 3.4 × 10 ^ 38 addresses.

• IPv6 uses 8 sets of four hexadecimal digits (separated by colons) instead of four sets

of one to three digits IPv4 address methods

You might also like