0% found this document useful (0 votes)
14 views71 pages

Chapter 5 DCC

Chapter 5 discusses the OSI Reference Model, which is a framework for understanding network communication through seven layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application. Each layer has specific functions and protocols that facilitate data transmission and communication between devices. The chapter emphasizes the importance of layered architecture for simplifying network design, debugging, and management.

Uploaded by

pranjalghatge18
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)
14 views71 pages

Chapter 5 DCC

Chapter 5 discusses the OSI Reference Model, which is a framework for understanding network communication through seven layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application. Each layer has specific functions and protocols that facilitate data transmission and communication between devices. The chapter emphasizes the importance of layered architecture for simplifying network design, debugging, and management.

Uploaded by

pranjalghatge18
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
You are on page 1/ 71

Chapter -5

5.1 OSI Reference Model

Objectives
 Concept of Reference Model.
 OSI Reference Model Concept.
 Layers of OSI Reference Model.

4.1 Introduction– Layered Architecture , Peer-to- Peer Processes, Interfaces between Layer,
Protocols, Organization of the Layers, Encapsulation.
4.2 Layers of the OSI Reference Model (Functions of each Layer & Protocols used) –Physical
Layer, Data-Link Layer, Network Layer, Transport Layer, Session Layer, Presentation
Layer, Application Layer.

4.1 Introduction– Layered Architecture


Communication Architecture
 Strategy for connecting host computers and other communicating equipment.
 Defines necessary elements for data communication between devices.
 A communication architecture, therefore, defines a standard for the communicating
hosts.
 A programmer formats data in a manner defined by the communication architecture
and passes it on to the communication software.
 Separating communication functions adds flexibility, for example, we do not need to
modify the entire host software to include more communication devices.
Why Layered Architecture?
 Layer architecture simplifies the network design.
 It is easy to debug network applications in a layered architecture network.
 The network management is easier due to the layered architecture.
 Network layers follow a set of rules, called protocol.
 The protocol defines the format of the data being exchanged, and the control and timing
for the handshake between layers.

1
Following Example shows need to have layered Architecture
• Assume Maria and Ann are neighbors with a lot of common ideas.
• However, Maria speaks only Spanish, and Ann speaks only English.
• Since both have learned the sign language in their childhood, they enjoy meeting in
a cafe a couple of days per week and exchange their ideas using signs.
• Occasionally, they also use a bilingual dictionary.
• Communication is face to face and Happens in one layer as shown in Figure.

• Now assume that Ann has to move to another town because of her job.
• Although both are sad, Maria opens a packet that contains two small machines.
• The first machine can scan and transform a letter in English to a secret code or
vice versa.
• The other machine can scan and translate a letter in Spanish to the same secret
code or vice versa.
• Ann takes the first machine; Maria keeps the second one.
• The two friends can still communicate using the secret code, as shown in Figure.

2
ISO –OSI Open Systems Interconnection Model
• International standard organization (ISO) established a committee in 1977 to
develop an architecture for computer communication.
• Open Systems Interconnection (OSI) reference model is the result of this effort.
• In 1984, the Open Systems Interconnection (OSI) reference model was approved as
an international standard for communications architecture.
• Term “open” denotes the ability to connect any two systems which conform to the
reference model and associated standards.
• The OSI model is now considered the primary Architectural model for inter -
computer communications.
• The OSI model describes how information or data makes its way from application
programmes (such as spreadsheets) through a network medium (such as wire) to
another application programme located on another network.
• The OSI reference model divides the problem of moving information between
computers over a network medium into SEVEN smaller and more manageable
problems is known as layering.
• The OSI model is a theoretical blueprint that helps us understand how data gets
from one user’s computer to another.
• It is also a model that helps develop standards so that all of our hardware and
software talks nicely to each other.
• It aids standardization of networking technologies.
• It provides an organized structure for hardware and software developers to follow,
to insure their products are compatible with current and future technologies.
 ISO is the organization; OSI is the model.

Fig: 7 Layers of ISO-OSI Reference Model

3
OSI: A Layered Network Model
• The process of breaking up the functions or tasks of networking into layers reduces
complexity.
• The lower 4 layers (transport, network, data link and physical - Layers 4, 3, 2, and 1)
are concerned with the flow of data from end to end through the network.
• The upper three layers of the OSI model (application, presentation and session-
Layers 7, 6 and 5) are orientated more toward services to the applications.
• The layers involved when a message is sent from device A to device B.
• As the message travels from A to B, it may pass through many intermediate nodes.
• These intermediate nodes involve only the first three layers of the OSI model.
• Each layer performs unique and specific task and it offers services to the layer
above it.
• For example, Layer 3 uses the services provided by layer 2 and provides
services for layer 4.

 Between machines, layer x on one machine communicates with layer x on another


machine.
 This communication is governed by an agreed-upon series of rules and conventions
called protocols.

4
Peer-to-Peer processes
• The processes on each machine that communicate at a given layer are called peer-
to-peer processes.
• At the physical layer, communication is direct: Device A sends a stream of bits to
device B (through intermediate nodes).
• At higher layers each layer in the sending machines adds its own information to the
message it receives from the layer just above it and passes the whole package to the
layer just below it.
Interfaces between Layers
• An interface defines the operations and services offered by lower layer to the upper
layer. This is an interface between each pair of adjacent layers.
• The passing of the data and network information down through the layers of the
sending device and receiving device is made possible by an interface between each
pair of adjacent layers.

Data Encapsulation
• The outgoing information will travel down through the layers to the lowest layer.
• While moving down on the source machine, it acquires all the control information
which is required to reach the destination machine.

5
• The control information is in the form of Headers and Trailer which surrounds the
data received from the layer above.
• This process of adding headers and trailers to the data is called as data
encapsulation.
• The information added by each layer is in the form of headers or trailers.
• At layer 1 the entire package is converted to a form that can be transferred to the
receiving machine.
• At the receiving machine, the message is unwrapped layer by layer, with each
process receiving and removing the data meant for it.
• For example, layer 2 removes the data meant for it, then passes the rest to layer 3.
• Layer 3 then removes the data meant for it and passes the rest to layer 4, and so on.
• The headers and trailers contain control information. The headers and trailers form
the envelope which carries the message to the desired destination.

Figure: Data Encapsulation


• D7 means the data unit at layer 7, D6 means the data unit at layer 6, and so on.
• The process starts at layer 7 (the application layer), then moves from layer to layer
in descending, sequential order.
• At each layer, a header, or possibly a trailer, can be added to the data unit.
• Commonly, the trailer is added only at layer 2.
• When the formatted data unit passes through the physical layer (layer 1), it is
changed into an electromagnetic signal and transported along a physical link.

6
Example of Data Encapsulation

The figure shows the example of five layer stack for data encapsulation.
 The fifth layer of sending machine wants to send a message M to the fifth layer of
destination machine.
 The message M is produced by layer 5 of machine 1 and given to layer 4 for
transmission. Layer 4 adds header H4 in front of the message and pass it to layer 3.
 Layer 3 breaks up the incoming message into small units as M1 and M2 and pass these
packets to layer 2.
 Layer 2 adds the header as well as footer to each packet obtained from layer 3 and pass
it to layer 1 for physical transmission.

4.2 Layers of the OSI Reference Model


1. Physical Layer
• It co-ordinates the functions required to transmit bit stream over physical medium.
• Provides physical interface for transmission of information.
• Defines rules by which bits are passed from one system to another on a physical
communication medium.
• Covers all - mechanical, electrical, functional and procedural - aspects for
physical communication.

The physical layer is responsible for the movement of individual bits from one hop
(node) to the next. 7
Functions of Physical Layer
• Physical characteristics of interfaces and medium.
• It also defines the type of transmission medium.
• How many pins the network connector has and what each pin is used for.
• Representation of bits. What electrical signals should be used to represent a 1 and a 0.
• Data rate: How many nanoseconds a bit lasts and bits per second.
• Synchronization of bits.
• Sender and Receiver must be synchronized
• Physical topology
• Mesh, Ring, Star, etc.
• Transmission mode. Whether transmission may proceed simultaneously in both
directions.
• Simplex, Half duplex, Duplex
2. Data Link Layer
• Data link layer attempts to provide reliable communication over the physical layer interface.
• Breaks the outgoing data into frames and re-assemble the received frames.
• Create and detect frame boundaries.
• Handle errors by implementing an acknowledgement and retransmission scheme.
• Implement flow control.

The data link layer is responsible for moving frames from one hop (node) to the next.

Functions of Data Link Layer


• Framing-
• Divides the stream of bits into manageable data units called frames.
• Physical addressing-
• Adds a header to the frame to define the sender and/or receiver of the frame.
• Flow control-
• Imposes a flow control mechanism to avoid overwhelming the receiver.
Synchronization between fast sender and slow receiver.
• Error control-
• Adds mechanisms to detect and retransmit damaged or lost frames (CRC).

8
• Access control-
• Determine which device has control over the link at any given time.
• Link establishment and termination:
• Establishes and terminates the logical link between two nodes.
• Frame sequencing:
• Transmits/receives frames sequentially.
• Frame acknowledgment:
• Provides/expects frame acknowledgments.
DLL is divided into two Sub-Layers
• LLC Sub Layer
• MAC Sub Layer

Logical Link Control Sub Layer


• It is upper portion of the Data Link layer.
• Performs Flow control and management of connection errors.
• LLC supports three types of connections:
1. Unacknowledged connectionless service:
• does not perform reliability checks or maintain a connection, very fast, most
commonly used
2. Connection oriented service:
• once the connection is established, blocks of data can be transferred between
nodes until one of the node terminates the connection.
3. Acknowledged connectionless service:
• provides a mechanism through which individual frames can be
acknowledged.
Media Access Control Sub Layer
• This sub layer contains methods to regulate the timing of data signals and
eliminate collisions.

9
• The MAC sub layer determines where one frame of data ends and the next one starts
- frame synchronization.
• There are four means of frame synchronization:
• Time based,
• Character counting,
• Byte stuffing and
• Bit stuffing.
3. Network Layer
• It is responsible for source to destination delivery of individual packets across
multiple networks.
• Defines the most optimum path the packet should take from the source to the
destination
• Defines logical addressing so that any endpoint can be identified.
• Handles congestion in the network.
• Facilitates interconnection between heterogeneous networks (Internetworking).
• The network layer also defines how to fragment a packet into smaller packets to
accommodate different media.

The network layer is responsible for the delivery of individual packets from the
source host to the destination host.

Functions of Network Layer


1. Logical addressing
2. Routing.
3. Congestion control
4. Accounting and billing
5. Address transformation
6. Source host to destination host error free delivery of packet.

10
Que: With the help of neat sketch describe the working of router. Describe in detail the
operation of router considering OSI model.
Answer: Router is a device that connects two or more computer network together this allows two
or more disparate computer network to send data to each other.

The figure shows a router connecting to two networks viz: A (Token Ring) and B
(Ethernet) at points X and Y respectively. This means that the router must have two
interfaces and also two Network interface cards (NICs) one to interact with network A at
point X, and the other to interact with network B at point Y. this enable it to send data
between the two networks A and B. A router connect more than two networks.

A router operates at a the physical, data link and network layer of the OSI model, as
shown in fig a router is termed as an intelligent device. A router is useful for
interconnecting two or more networks. These networks can be heterogeneous, which
means that they can differ in their physical characteristics such as frame size, transmission
rates, topologies, addressing etc. thus, if a router has to connect such different networks, it
has to consider all these issues. A router has to determine the best possible transmission
path among several available.

4. Transport Layer
• Purpose of this layer is to provide a reliable mechanism for the exchange of data
between two processes in different computers.
• Ensures that the data units are delivered error free.
• Ensures that data units are delivered in sequence.
• Ensures that there is no loss or duplication of data units.
• Provides connectionless or connection oriented service.

11
The transport layer is responsible for the delivery of a message from one process to another.

Functions of Transport Layer


1. Service point addressing
2. Segmentation and reassembly
3. Connection control
4. Flow control: Flow control is performed end to end
5. Error control

5. Session Layer
• Session layer provides mechanism for controlling the dialogue between the two
end systems.
• It defines how to start, control and end conversations (called sessions) between
applications.
• This layer requests for a logical connection to be established on an end-user’s
request.
• Any necessary log-on or password validation is also handled by this layer.
Functions of Session Layer
• Dialog control
• Synchronization, session and sub session
• Session closure

6. Presentation Layer
• Presentation layer defines the format in which the data is to be exchanged between
the two communicating entities.
• Also handles data compression and data encryption (cryptography).

12
Functions of Presentation layer:
• Translation: presentation layer is responsible for converting various formats into
required format of the recipient.
• Encryption: Data encryption and decryption is done by presentation layer for
security.
• Compression and Decompression: data to be transform compressed while
sending and decompress while receiving for reducing time of transmission.

7. Application Layer
• Application layer interacts with application programs and is the highest level of OSI
model.
• Application layer contains management functions to support distributed
applications.
• Examples of application layer are applications such as
• File Transfer,
• Electronic Mail,
• Remote Login Etc.
Functions of Application layer:
1. Network virtual terminal
2. File transfer access and management
3. Mail services and directory services

Horizontal communication

13
1. The horizontal communication is the logical connection between the layers, there is
no direct communication between them.
2. Information included in each protocol header by the transmitting system is a
message that will be carried to the same protocol in the destination system.
3. For two computers to communicate over a n/w, the protocol used at each layer of
the OSI model in the transmitting system must be duplicated at the receiving system.
4. The packet travels up through the protocol stack and each successive header is
stripped of by the appropriate protocol & processed.
5. When the packet arrived at its destination, the process by which the headers are
applied at the source is repeated in server.

Vertical communication:
1. In addition to communicating horizontally with the same protocol in the other
system, the header information also enables each layer to communicate with the
layer above & below it.
Eg. The n/w layer will communicate with the data link layer & transport layer.
2. This interlayer communication is called communication vertical.
3. When a system receives a packet & passes it up through various layers the data link
layer protocol header includes a field which specifies the name of n/w layer
protocol to be used to process the packet.
4. The n/w layer protocol header will specify the name of transport layer protocol to
be used to process the packet.
5. Due to vertical communication, it becomes protocol at each layer simultaneously.

Fig: Vertical communication

14
Summery

Protocols in Each Layer


Protocols - Layer 7 HTTP FTP SMTP POP DNS Telnet
Protocols - Layer 6 Graphics: TIFF, JPEG, GIF Text: ASCII, EBCDIC, Unicode, Encrypted Audio:
Midi, MPEG, WAV, MP3 Video: Quicktime, AVI
Protocols - Layer 5 NFS - Network File System RPC - Remote Procedure Call ASP - Appletalk
Session Protocol
Protocols - Layer 4 Connection Oriented (TCP) Connectionless (UDP)
Protocols - Layer 3 Routed Routing (IP)
Protocols - Layer 2 MAC - Media Access Control LLC - Logical Link Control
Protocols - Layer 1 Organizations: IEE, TIA/ETA, ANSI, etc. Cable (ie. RJ45)

Devices
Devices - Layer 7 Hosts PC Servers Mobile Phones, gateways
Devices - Layer 3 Routers
Devices - Layer 2 Bridges, Switches, NIC (Layers 1 & 2)
Devices - Layer 1 Hubs, repeaters NIC (Layers 1 & 2) Media: Coax, Fiber,
Twisted Pair, Wireless

15
Chapter 5
IP Addressing and TCP/IP SUITE

Objectives:-
 TCP/ IP Model Concept.
 Defining/functioning of different Layers of TCP / IP suite.

5.1 Introduction –Addressing mechanism in the Internet


 An IP address is an address used in order to uniquely identify a device on an IP
network.
 The address is made up of 32 binary bits, which can be divisible into a network
portion and host portion with the help of a subnet mask.
 The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is
converted to decimal and separated by a period (dot).
 For this reason, an IP address is said to be expressed in dotted decimal format
(for example, 172.16.81.100).
 The value in each octet ranges from 0 to 255 decimal, or 00000000 − 11111111
binary.
 The Internet Assigned Numbers Authority (IANA) assigns network identifiers to
avoid duplications.

5.2 IP Addressing – IP Address classes, classless IP addressing, Subnetting,


supernetting, Masking.
 IPv4 addresses are unique.
 They are unique in the sense that each address defines one, and only one,
connection to the Internet.
 Two devices on the Internet can never have the same address at the same time.

Address Space:
 IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than 4 billion).
 This means that, theoretically, if there were no restrictions, more than 4 billion
devices could be connected to the Internet.

Notations
There are two prevalent notations to show an IPv4 address: Binary notation and Dotted
decimal notation.
 Binary Notation:
o In binary notation, the IPv4 address is displayed as 32 bits.
o Each octet is often referred to as a byte.

1
o So it is common to hear an IPv4 address referred to as a 32-bit address or a
4-byte address.
o The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010

 Dotted-Decimal Notation:
o 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.
o Each byte is identified by a decimal number in the range [0..255].
o The following is the dotted decimal notation of the above address:
117.149.29.2
o Example:

Example: Change the following IPv4 addresses from binary notation to dotted-
decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Solution:
We replace each group of 8 bits with its equivalent decimal number and add dots for
separation.
a. 129.11.11.239
b. 193.131.27.255

IP Address classes
 IPv4 addressing, at its inception, used the concept of classes.
 This architecture is called classful addressing.
 In classful addressing, the address space is divided into five classes: A, B, C, D,
and E.
 Each class occupies some part of the address space.
 We can find the class of an address when given the address in binary notation or
dotted-decimal notation.
 If the address is given in binary notation, the first few bits can immediately tell
us the class of the address.

2
Fig: Finding the class in binary notation.

 If the address is given in decimal-dotted notation, the first byte defines the
class.

Fig: Finding the class in decimal notation


Example: Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution:
a. The first bit is O. This is a class A address.
b. The first 2 bits are 1; the third bit is O. 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.
Classes and Blocks
One problem with classful addressing is that each class is divided into a fixed
number of blocks with each block having a fixed size.

Fig: Number of blocks and block size in classful IPv4 addressing.

3
Class A:
• The high-order (First) bit in a class-A address is always set to zero.
• The next seven bits complete the network ID.
• The remaining 24 bits represent the host ID.
• This allows for 128 networks and 16,777,214 hosts per network.
• In this 7 bits are used for network field and 24 bits for host field.
• Class A IP address range includes 1.0.0.0 to 127.255.255.255

Note: Millions of class A addresses are wasted.

Class B:
• Class B addresses are assigned to medium-sized to large-sized networks.
• The two high-order bits in a class B address are always set to binary 1 0.
• The next 14 bits complete the network ID.
• The remaining 16 bits represent the host ID.
• This allows for 16,384 networks and 65,534 hosts per network.
• Class B IP address range includes 128.0.0.0 to 191.255.255.255

Class C:
• Class C addresses are used for small organizations with a small number of attached
hosts or routers.
• The three high-order bits in a class C address are always set to binary 1 1 0.
• The next 21 bits complete the network ID.
• The remaining 8 bits (last octet) represent the host ID.
• This allows for 2097152 networks and 256 hosts per network.
• Class C IP address range includes 192.0.0.0 to 223.255.255.255.

Class D:
• Class D addresses are reserved for IP multicast addresses.
• The four high-order bits in a class D address are always set to binary 1 1 1 0.
• The remaining bits recognize hosts.
• Class D IP address range includes 224.0.0.0 to 239.255.255.255

4
Class E:
• Class E is an experimental address that is reserved for future use.
• The high-order bits in a class E address are set to binary 1111.
• Class E IP address range includes 240.0.0.0 to 255.255.255.255

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, one byte defines the netid and three bytes define the hostid.
 In class B, two bytes define the netid and two bytes define the hostid.
 In class C, three bytes define the netid and one byte defines the hostid.

Mask
 Although the length of the netid and hostid (in bits) is predetermined in classful
addressing, we can also use a mask (also called the default mask/natural masks), a 32-
bit number made of contiguous 1’s followed by contiguous 0’s.
 The masks for classes A, B, and C are shown in Table.
 The concept does not apply to classes D and E.

 The mask can help us to find the netid and the hostid.
 For example, the mask for a class-A address has eight 1s, which means the first 8 bits of
any address in class A define the netid; the next 24 bits define the hostid.

Subnetting
 If an organization was granted a large block in class A or B, it could divide the addresses
into several contiguous groups and assign each group to smaller networks (called
subnets) or, in rare cases, share part of the addresses with neighbors.
 Subnetting increases the number of 1’s in the mask.
 To create multiple logical networks that exist within a single Class A, B, or C network.
 If you do not subnet, you are only able to use one network from your Class A, B, or C
network, which is unrealistic.
5
 The subnet mask follows two rules:
o If a binary bit is set to a 1 (or on) in a subnet mask, the corresponding bit in the
address identifies the network.
o If a binary bit is set to a 0 (or off) in a subnet mask, the corresponding bit in the
address identifies the host.

Finding The Subnet Address: We use binary notation for both the address and the mask
and then apply the AND operation to find the subnet address.
Example: What is the subnetwork address if the destination address is 200.45.34.56 and
the subnet mask is 255.255.240.0?
Solution :
Step 1: Convert given IP and Subnet mask to Binary
Step 2: Perform AND Operation on these two.
11001000 00101101 00100010 00111000 Binary 200.45.34.56
11111111 11111111 11110000 00000000 Subnet Mask 255.255.255.0

11001000 00101101 00100000 00000000


The subnetwork address is 200.45.32.0.
Step 3: Convert the result of AND operation to Dotted Decimal format which is Subnet mask.
Example 2: (VIMP)
A company is granted the site address 201.70.64.0 (class C). The company needs six
subnets. Design the subnets.
Solution:
 The number of 1s in the default mask is 24 (class C).
 The company needs six subnets.
 This number 6 is not a power of 2.
 The next number that is a power of 2 is 8 (23).
 We need 3 more 1’s in the subnet mask.
 The total number of 1’s in the subnet mask is 27 (24 + 3).
 The total number of 0’s is 5 (32 - 27).
 The mask is
11111111 11111111 11111111 11100000
or
255.255.255.224
 The number of subnets is 8.
 The number of addresses in each subnet is 25 (5 is the number of 0s) or 32.

6
 Subnet 1:
The bit combination is 001.
Taking last octet in binary:0 0 1 0 0 0 0 0 = 32 (10)
Hence the subnet address is, 201.70.64. 32
 Subnet 2:
The bit combination is 01 0.
Taking last octet in binary:0 0 1 0 0 0 0 0 = 64(10)
Hence the subnet address is, 201.70.64. 64
 Subnet 3:
The bit combination is 011.
Taking last octet in binary:0 1 1 0 0 0 0 0 = 96(10)
Hence the subnet address is, 201.70.64. 96
 Subnet 4:
The bit combination is 100.
Taking last octet in binary :1 0 0 0 0 0 0 0 = 128(10)
Hence the subnet address is, 201.70.64. 128
 Subnet 5:
The bit combination is 101.
Taking last octet in binary :1 0 1 0 0 0 0 0 = 160(10)
Hence the subnet address is, 201.70.64. 160
 Subnet 6:
The bit combination is 110.
Taking last octet in binary :1 1 0 0 0 0 0 0 = 192 (10)
Hence the subnet address is, 201.70.64. 192

Example 3:
A company is granted the site address 181.56.0.0 (class B). The company needs 1000
subnets. Design the subnets.
Solution:
 The number of 1s in the default mask is 16 (class B).
 The company needs 1000 subnets.
 This number is not a power of 2.
 The next number that is a power of 2 is 1024 (210).
 We need 10 more 1’s in the subnet mask.
 The total number of 1’s in the subnet mask is 26 (16 + 10).
 The total number of 0’s is 6 (32 - 26).
 The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192
7
 The number of subnets is 1024.
 The number of addresses in each subnet is 26 (6 is the number of 0s) or 64.

Supernetting
 The most of the class A and class B addresses were exhausted; however, there was still
a huge demand for midsize blocks.
 The size of a class C block with a maximum number of 256 addresses did not satisfy the
needs of most organizations.
 One solution was supernetting.
 In supernetting, an organization can combine several class C blocks to create a larger
range of addresses.
 In other words, several networks are combined to create a supernetwork or a supernet.
 An organization can apply for a set of class C blocks instead of just one.
 For example, an organization that needs 1000 addresses can be granted four contiguous
class C blocks.
 The organization can then use these addresses to create one supernetwork.
 Supernetting decreases the number of 1’s in the mask.
 For example,
o if an organization is given four class C addresses, the mask changes from 24 to 22.
Example:
 We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?
Solution:
 We need 16 blocks.
 For 16 blocks we need to change four 1s to 0s in the default mask. So the mask is
11111111 11111111 11110000 00000000
Or

8
255.255.240.0
Address Depletion
 The flaws in classful addressing scheme combined with the fast growth of the
Internet lead to the near depletion of the available addresses.
 Yet the number of devices on the Internet is much less than the 232 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 alleviated the problem is the idea of classless addressing.

Classless Addressing
 To overcome address depletion and give more organizations access to the
Internet, classless addressing was designed and implemented.
 In this scheme, there are no classes, but the addresses are still granted in blocks.
Address Blocks
 In classless addressing, when an entity, small or large, needs to be connected to
the Internet, it is granted a block (range) of addresses.
 The size of the block (the number of addresses) varies based on the nature and
size of the entity.
 For example, a household may be given only two addresses; a large organization
may be given thousands of addresses.
 An ISP, as the Internet service provider, may be given thousands of addresses
based on the number of customers it may serve.
Restriction: To simplify the handling of addresses, the Internet authorities impose
three 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:
A company needs 600 addresses. Which of the following set of class C blocks can be used to
form a supernet for this company?
1. 198.47.32.0 198.47.33.0 198.47.34.0
2. 198.47.32.0 198.47.42.0 198.47.52.0 198.47.62.0
3. 198.47.31.0 198.47.32.0 198.47.33.0 198.47.52.0
4. 198.47.32.0 198.47.33.0 198.47.34.0 198.47.35.0
Solution:
1: No, there are only three blocks.
2: No, the blocks are not contiguous.
3: No, 31 in the first block is not divisible by 4.
4: Yes, all three requirements are fulfilled.

9
5.3 Layered Structure of the TCP / IP Model – Host-to-Network, Internet,
Transport, Application Layer.
 The TCP/IP protocol suite was developed prior to the OSI model.
 Therefore, the layers in the TCP/IP protocol suite do not exactly match those in the
OSI model.
 The original TCP/IP protocol suite was defined as having four layers: host-to-
network, internet, transport, and application.

Fig: TCP/ IP Model

 When TCP/IP is compared to OSI,


 The host-to-network layer is equivalent to the combination of the physical and
data link layers.
 The internet layer is equivalent to the network layer, and the application layer
doing the job of the session, presentation, and application layers.

Network Access Layer

 Also called as Host-to-Network Layer.


 Performs all functions of physical Layer and Data Link Layer.
 Exchange of data between end system and network.
 Address of host and destination
 Prioritization of transmission.
 This deals with hardware level, connections as in other network model.
 TCP/IP Protocol Suite includes Host-to-Network Layer protocols such as-
 Serial Line Internet Protocol (SLIP) And Point to Point Protocol (PPP).

TCP/IP Internet Layer


 An Internet is an interconnection of two or more networks.
 Internet layer handles tasks similar to network access layer, but between networks
rather than between nodes on a network.
 Uses IP for addressing and routing across networks.
 Implemented in workstations and routers.

10
 This layer is concerned with the format of datagrams as defined in the internet
protocol(IP).
 The protocols in this layer include Address Resolution Protocol (ARP),
 Reverse Address Resolution Protocol (RARP) and
 Internet Control Message Protocol (ICMP).

TCP/IP Transport Layer


 This layer is concerned with the transmission of the data.
 The two main protocols that operate at this layer are Transmission Control Protocol
(TCP) and User Datagram Protocol (UDP).
 TCP is reliable transmission protocol and it guarantees that the proper data transfer
will take place.
 UDP is not designed to be reliable or guarantee data delivery.
 Also called host-to-host layer.

Functions of Transport Layer
1. Service point addressing: - Delivery is from specific process on computer to
specific process on another computer. For this transport layer uses port addresses.
2. Segmentation and reassemble: -Each segment of a message contains a sequence
number which is used to reassemble the message correctly.
3. Connection control:-Logical connection is created between source and destination
for the duration of complete message transfer.
4. Flow control:-Flow control is performed end to end.
5. Error control:-Error control is performed process to process. It ensures that entire
message arrives at receivers transport layer without error (damage or loss or
duplication). Error correction is done by retransmission.

TCP/IP Application Layer


 The application layer is concerned with providing network services to applications.
 There are many application network processes and protocols that work at this layer,
including
 Hyper Text Transfer Protocol (HTTP), Simple Mail Transport Protocol (SMTP) and
File Transfer Protocol (FTP).

5.4 TCP / IP Protocol Suite:


Host-to-Network-SLIP and PPP,
Internet Layer-ARP, RARP and IP:Introduction, IPv4, IPv6 ( Header Format), Difference
between IPv4 & IPv6.
Transport Layer- TCP and UDP ( Frame Format, port addresses),
Application Layer- FTP, SMTP, DNS.

11
Fig: TCP/ IP Protocol Suite
 Host-to-Network Layer Protocol
 Host to network Layer Defines two protocols
 SLIP
 PPP
 SLIP and PPP Protocols allow a user to dial into an ISP over Telephone Line.

SLIP (Serial Line Internet Protocol)


 It designed to work over serial ports and modem connections.
 Defines a sequence of bytes that frame IP packets on a serial line.
 Commonly used for point-to-point serial connections running TCP/IP.
 It is designed to transmit signals over a serial connection and has very low overhead.
 Data transmission with SLIP is very simple.
 This protocol sends a frame composed only of data to be sent followed by an end
of transmission character (the END character, the ASCII code 192).
 A SLIP frame looks like:

Problems with SLIP


 SLIP does not perform error detection and correction.
 SLIP does not provide any authentication.
 SLIP is not approved internet standard.
 SLIP supports static IP address assignment.

PPP (Point to Point Protocol)


 It is a much more developed protocol than SLIP(which is why it is replacing it).
 It transfers additional data, better suited to data transmission over the Internet.
 PPP is More Complex than SLIP.
 PPP Protocol Supports a set of Authentication Protocol.
Line Control Protocol (LCP):
 Responsible for establishing, maintaining, and terminating connection.

12
Password Authentication Protocol(PAP):
 The second is of authentication.
 Password Authentication is used.
Network Control Protocol (NCP):
 After authentication is done, PPP sends NCP packet.
 This packet tells ISP server what kind of traffic is to be passed over PPP link.
IP Control Protocol (IPCP):
 Finally the IP packets are exchanged.
 IPCP Establishes and terminates the Network layer connection.

PPP Solves the problems of SLIP


 PPP is point to point protocol.
 PPP perform error detection.
 PPP provides authentication and security.
 PPP is approved internet standard.
 PPP supports IP and other protocols.
 PPP supports Dynamic IP address assignment
PPP Frame Format

SLIP Vs PPP

SLIP PPP
Serial Line Internet Protocol does In PPP, LCP (Line Control Protocol) is
not establish or maintain connection responsible for establishing, maintaining and
between the client and ISP server. termination connection between two end
points.
Communication starts once the Communication begins only after
connection between two modems authentication and the types of traffic is sent
are established. by the client.
Type of traffic cannot be selected in Type of traffic can be selected by
SLIP. NCP( Network Control Protocol)
No protocol for termination. IPCP(IP Control Protocol) terminates a
network layer connection between the user
and ISP.
No addressing mechanism provided. Additional services for addressing mechanism
is provided
Doesn’t allow error control Allows error control
No provision for data compression Provides Data compression.

2. Internet Layer Protocols


13
 The Four Network Layer protocols are:
 ARP
 RARP
 IP
 ICMP

1. ARP-Address Resolution Protocol

 ARP takes the IP address of a host as input & gives its corresponding physical
address as the output.
 The Internet is based on IP addresses
 Data link protocols (Ethernet, FDDI, ATM) may have different (MAC)
addresses
 The ARP and RARP protocols perform the translation between IP addresses and
MAC layer addresses.

ARP Ethernet MAC


IP address
address
(32 bit)
(48 bit)
RARP

 ARP sends the IP broadcast message to all the computer on the network.
 The computer whose IP address matches the broadcast IP address sends a reply and
along with, its physical address to the broadcasting computer.
 All other computers ignore the broadcast message.
Address Translation with ARP
Example:
ARP request: Argon broadcasts an ARP request to all stations on the network: “What is
the hardware address of Router137?”

ARP Reply: Router137 responds with an ARP Reply which contains the hardware address

14
ARP Packet Format

E th e rn e t II h e a d e r

D e s tin a tio n S o u rce Type


a d d re s s a d d re ss 0 x8 060
A R P R e q u e s t o r A R P R e p ly P a d d in g CRC

6 6 2 28 10 4

H a rd w a re typ e (2 b yte s ) P ro to co l ty p e (2 b y te s )
H a rd w a re a d d re s s P ro to co l a d d re ss
O p e ra tio n c o d e (2 b y te s)
le n g th (1 b y te ) le n g th (1 b yte )
S o u rce h a rd w a re a d d re s s *

S o u rc e p ro to c o l a d d re s s*

T a rg e t h a rd w a re a d d re s s*

T a rg e t p ro to co l a d d re ss *

* N o te : T h e le n g th o f th e a d d re s s fie ld s is d e te rm in e d b y th e c o rre s p o n d in g a d d re s s le n g th fie ld s

2. RARP (Reverse Address Resolution Protocol)


 If we have to obtain the IP address corresponding to the given Ethernet address.
 RARP works in very similar way of ARP, but in exactly opposite direction.
 The RARP server looks at this request.
 Then it looks up the Ethernet address in its configuration files and sends back the
corresponding IP address.

3. Internet Protocol (IP)


 IP is internet Protocol.
15
 It is unreliable protocol because it does not provide any error control and flow
control.
 Packets in IP are called “Datagram”.
 Datagram is variable length packet with two parts –header and data

IP Header Format

Fields Of IP Header:
 Version (4 bits): current version is 4.
 Header length (4 bits): length of IP header, in multiples of 4 bytes
 DS/ECN field (1 byte): This field was previously called as Type-of-Service (TOS)
field.
 Differentiated Service (DS) (6 bits): Used to specify service level (currently
not supported in the Internet)
 Explicit Congestion Notification (ECN) (2 bits):New feedback mechanism
used by TCP.
 Identification (16 bits): Unique identification of a datagram from a host.
Incremented whenever a datagram is transmitted.
 Flags (3 bits):
 First bit always set to 0
 DF bit (Do not fragment)
 MF bit (More fragments)

 Time To Live (TTL) (1 byte): Specifies longest paths before datagram is dropped.

16
Role of TTL field: Ensure that packet is eventually dropped when a routing
loop occurs.
Used as follows:
 Sender sets the value (e.g., 64)
 Each router decrements the value by 1
 When the value reaches 0, the datagram is dropped
 Protocol (1 byte):
 Specifies the higher-layer protocol.

 Header checksum (2 bytes):


 A simple 16-bit long checksum which is computed for the header of the
datagram.
 The receiving host will discard the packet if it fails the checksum calculation.
 Options: Security restrictions
 Record Route: each router that processes the packet adds its IP address to
the header.
 Timestamp: each router that processes the packet adds its IP address and
time to the header.
 Source Routing: specifies a list of routers that must be traversed.
 Padding: Padding bytes are added to ensure that header ends on a 4-byte boundary.
 Source and Destination Address: 32 bit IP address.

Functions of the IP
1. Addressing:
 In order to perform the job of delivering datagrams, IP must know where to
deliver them to. For this reason, IP includes a mechanism for host addressing.
2. Data Encapsulation and Formatting/ Packaging:
 IP accepts data from the transport layer protocols UDP and TCP.
 It then encapsulates this data into an IP datagram using a special format
prior to transmission.

3. Fragmentation and Reassembly:

17
 IP fragment IP datagrams into pieces.
 The receiving device uses the reassembly function to recreate the whole IP
datagram again.
4. Routing / Indirect Delivery:
 When an IP datagram must be sent to a destination on the same local
network, this is done using direct delivery.
 However, if the final destination is on a distant network not directly attached
to the source datagram must be delivered indirectly.
IPV6
 IP version 6 (IPv6) is an advanced version of IPv4.
 It takes all good features of IPv4 and adds new ones.
 Larger address space: IPv6 uses 128 bit(16 Bytes) Address.
 Better header format: This simplifies and speeds up the routing process.
 New options. IPv6 has new options to allow for additional functionalities.
 Allowance for extension: IPv6 is designed to allow the extension of the protocol if
required by new technologies or applications.
IPv6 major goals:
1. Support billions of hosts.
2. Reduce the size of the routing tables.
3. Simplify the protocol.
4. Provide better security (authentication and privacy).
5. More attention to the type of service
6. Aid multicasting by allowing scopes to be specified.
7. Make it possible for a host to roam without changing its address.
8. Allow the protocol to evolve in the future.
9. Permit the old and new protocols to coexist for years.

IPv6 Header Format

Header Fields:
 Version (4-bit): Defines the version number of the IP. For IPv6, the value is 6.
 Priority(4-bit): Defines the priority of the packet with respect to traffic congestion.
 Flow label (3-byte /24-bit): It is designed to provide special handling flow of data.
 Payload length(2-byte): Defines the length of the IP datagram excluding the base
header.
18
 Hop limit (8-bit): Serves the same purpose as the TTL field in IPv4.
 Next header (8-bit):
 Defines 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.
 Note that this field in version 4 is called the protocol.
 Source address.:
 The source address field is a 16-byte (128-bit)
 Internet address that identifies the original source of the datagram.
 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.
IPv4 IPv6
1. Source and destination addresses are 1. Source and destination addresses are 128
32 bits (4 bytes) in length. bits(16 bytes)in length.
2. Uses broadcast addresses to send 2. There are no IPv6 broadcast addresses.
traffic to all nodes on a subnet. Instead, multicast scoped addresses are
used.
3. Fragmentation is supported at 3. Fragmentation is not supported at routers.
Originating hosts and intermediate It is only supported at the
routers.
4. IP header include a checksum. 4. IP header does not include a checksum.
5.IP header includes options. 5. All optional data is moved toIPv6
extension headers.
6.IPsec support is optional 6.IPsec support is required in a full IPv6
implementation.
7. No identification of payload for QoS 7. Payload identification for QoS handling By
Handling by routers is present within routers is included in theIPv6 header using
the IPv4 header. the Flow Label field.
8. Address must be configured either 8. Addresses can be automatically assigned
manually or through DHCP. using stateless address auto configuration,
assigned using DHCPv6, or manually
configured.
9. IP address represented in decimal 9. IP address is represented in hexadecimal
number system number system
10. “.” used as seperator 10. ‘ : ‘ used as separator .
11. Uses host address (A) resource 11. Uses host address (AAAA) resource
records in the domain name system to records in the domain name system to map
map host names to IPv4 addresses. host names to IPv6 addresses.

4. ICMP
 It is internet control message protocol.
19
 It reports error and sends control messages.
 Error reporting messages include – destination unreachable, source quench ,
time exceed, parameter problem, redirection etc.
 Query message includes –echo request and reply, time stamp request and reply,
router solicitation and advertisement, etc.

Transport Layer Protocols


 Transport Layer Works on top of Internet Layer.
 It is concerned with transport of packets from the source to destination.
 In TCP/IP the transport layer is represented by two Protocols:
 TCP
 UDP

1. Transmission Control Protocol (TCP)


 TCP is transmission control protocol.
 It Provides:
 Connection oriented service
 Reliable service
 Stream delivery service
 Sending and receiving buffers
 Bytes and segments
 Full duplex service

 TCP is a connection oriented protocol.


 Connection oriented means that a virtual connection is established before any
user data is transferred.
 If the connection cannot be established, the user program is notified.
 If the connection is ever interrupted, the user program finds out there is a problem.

 TCP is Reliable-
 Reliable means that every transmission of data is acknowledged by the receiver.
 Reliable does not mean that things don't go wrong, it means that we find out when
things go wrong.
 If the sender does not receive acknowledgement within a specified amount of time,
the sender retransmits the data.

 Stream delivery service:


 TCP is a stream oriented protocol.
 It allows the sending and receiving process to obtain as a stream of bytes.
20
 TCP creates a working environment in such a way that the sending and
receiving processes seem to be connected by an imaginary “tube” This is
called as stream delivery service.
 TCP : Flow Control
 Sending and receiving buffers:
 The sending and receiving process may not produce and receive data at
the same speed.
 Hence TCP needs buffers for storage.
 There are two types of buffers used in each direction:
1) Sending buffer
2) Receiving buffer
 Full duplex service:
 TCP offers full duplex service where the data can flow in both the direction
simultaneously.
 The TCP segments are sent both the directions.

 Process to process communication:


 The TCP uses port numbers as transport layer addresses.
 Also called as Port to Port communication.
TCP Header

2. UDP
 UDP is user datagram protocol.
 It is connectionless protocol because data is sent without establishing a connection
between sender and receiver before sending the data.
 UDP is unreliable because data is delivered without acknowledgement.
 UDP does not perform Auto retransmission.
 UDP does not use flow control .
 UDP has high transmission speed.

UDP Datagram Format

21
UDP Vs TCP
UDP TCP
Complexity UDP is less complex TCP is more complex
Connection UDP is connection less protocol TCP is connection oriented protocol
Reliability It provides unreliable delivery It provides reliable delivery of
of messages messages
Function By using this protocol one As a message makes its way across
program can send a load of the internet from one computer to
packets to another and that another. This is connection based.
would be the end of the
relationship.
layer they exist Transport layer Transport layer
Flow controlling UDP has no flow control TCP has flow control
Overhead Overhead is very low Overhead is low
Which is powerful UDP is less powerful TCP is more powerful.

Application Layer Protocols


 SMTP
 FTP
 DNS
 Telnet

SMTP
 SMTP is simple mail transfer protocol.
 It is connection oriented text based protocol.
 Sender communicates with receiver using a command and supplying data over
reliable TCP connection.
 SMTP is standard application layer protocol for delivery of email over TCP/IP
network.
 SMTP establish a TCP connection between sender and port number 25 of receiver.
 Electronic Mail

22
 Three major components:
 user agents
 mail servers
 simple mail transfer protocol: SMTP
User Agent
 Also called as “mail reader”
 composing, editing, reading mail messages e.g., Eudora, Outlook, Mozilla
Thunderbird
 outgoing, incoming messages stored on server.
Mail Servers
 mailbox contains incoming messages for user
 message queue of outgoing (to be sent) mail messages
SMTP
 protocol between mail servers to send email messages
 client: sending mail server
 “server”: receiving mail server
Scenario: Alice sends message to Bob
1) Alice uses UA to compose message and “to” [email protected]
2) Alice’s UA sends message to her mail server; message placed in message queue
3) Client side of SMTP opens TCP connection with Bob’s mail server
4) SMTP client sends Alice’s message over the TCP connection
5) Bob’s mail server places the message in Bob’s mailbox
6) Bob invokes his user agent to read message

23
Sample SMTP interaction

FTP
 FTP is used for copying a file from one host to the other.
 Some of the problem in transferring files :
 Two systems may use different file name conventions.
 Two systems may represent text data in different types.
 The directory structure of the two systems may be different.
 FTP provides a simple solution to all these problems.
 FTP established two connections between the client and server.
 One is for data transfer and the other is for the control information.

FTP file transfer


FTP FTP
user client
server
interface
user
at host
local file
system
remote file system

24
FTP: separate control, data connections
 FTP client contacts FTP server at port 21
 client authorized over control connection.
 client browses remote directory by sending commands over control connection.
 when server receives file transfer command, server opens 2nd TCP connection (for
file) to client after transferring one file, server closes data connection.
 server opens another TCP data connection to transfer another file.
 FTP server maintains “state”: current directory, earlier authentication.

 Control connection:
 Control connection remains alive during the entire process.
 The IP uses minimize delay type services because this is an interactive
connection between a user and server.

 Data Connection:
 Data connection uses the port 20 at the site.
 This connection is opened when data to be transferred is ready and it is
closed when transfer of data is over.
 The service types used by IP is maximize throughput.

TELNET
 TELNET is abbreviation for Terminal Network.
 It is standard TCP/IP protocol for virtual terminal services proposed by ISO.
 TELNET enables establishment of connection to a remote system in such a way that
a local terminal appears to be terminal at remote system.
 TELNET is general purpose client server application program.
Remote login
 When user wants to access the application or utility located at the remote
machine ,he or she performs remote login.
 Here the telnet client and server program come into use.

25
 The user sends the keystrokes to local operating system. local operating system
accept is, but do not interpret them.
 The characters are send to TELNET client.
 TELNET client transform the character to a universal character set called Network
Virtual Terminal Character and deliver them to the local TCP/IP stack.

DNS-Domain Name System


 Domain name is human readable name assigned to computer on the internet.
 Domain refers to group of computers called by common name.
 DNS is TCP/IP Application that maps Human Readable computer names to IP
Addresses.
 DNS translates internet domain and host names to IP Addresses.

Example: Client wants IP for www.amazon.com:


 client queries a root server to find com DNS server
 client queries com DNS server to get amazon.com DNS server
 client queries amazon.com DNS server to get IP address for www.amazon.com

Summery
 Connectionless protocols:
 IP
 ICMP
 UDP
 Connection oriented protocol:
 TCP
 SLIP
 PPP
 SMTP

26
5.5 Comparison between OSI and TCP / IP Network Model.
OSI reference model TCP/IP network model
1)It has 7 layers 1)It has 4 layers
2)Transport layer guarantees delivery 2)Transport layer does not guarantees
of packets delivery of packets
3)Horizontal approach 3)Vertical approach
4)Separate presentation layer 4)No session layer, characteristics are
provided by transport layer
5)Separate session layer 5)No presentation layer, characteristics
are provided by application layer
6)Network layer provides both 6)Network layer provides only
connectionless and connection oriented connection less services
services
7)It defines the services, interfaces and 7)It does not clearly distinguishes
protocols very clearly and makes a clear between service interface and protocols
distinction between them
8)The protocol are better hidden and 8)It is not easy to replace the protocols
can be easily replaced as the technology
changes
9)OSI truly is a general model 9)TCP/IP cannot be used for any other
application
10)It has a problem of protocol filtering 10) The model does not fit any protocol
into a model stack.

27
SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Chapter 5 Marks 20

Reference Models
THE OSI MODEL
Established in 1947, the International Standards Organization (ISO) is a
multinationalbody dedicated to worldwide agreement on international standards. An ISO
standardthat covers all aspects of network communications is the Open Systems
Interconnectionmodel. It was first introduced in the late 1970s. An open system is a set of
protocols thatallows any two different systems to communicate regardless of their
underlying architecture.The purpose of the OSI model is to show how to facilitate
communicationbetween different systems without requiring changes to the logic of the
underlying hardwareand software. The OSI model is not a protocol; it is a model for
understanding anddesigning a network architecture that is flexible, robust, and
interoperable.
The OSI model is a layered framework for the design of network systems thatallows
communication between all types of computer systems. It consists of seven separatebut
related layers, each of which defines a part of the process of moving informationacross a
network (see Figure 5.1). An understanding of the fundamentals of the OSImodel provides a
solid basis for exploring data communications.

Figure 5.1 The seven- layer OSI model

Layered Architecture
The OSI model is composed of seven ordered layers: physical (layer 1), data link (layer
2),network (layer 3), transport (layer 4), session (layer 5), presentation (layer 6),
andapplication (layer 7). Figure 5.2 shows the layers involved when a message is sent
fromdevice A to device B. As the message travels from A to B, it may pass through

Mr. P R Sali 1 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

manyintermediate nodes. These intermediate nodes usually involve only the first three
layersof the OSI model.
In developing the model, the designers distilled the process of transmitting data toits
most fundamental elements. They identified which networking functions had relateduses
and collected those functions into discrete groups that became the layers. Eachlayer defines
a family of functions distinct from those of the other layers. By definingand localizing
functionality in this fashion, the designers created an architecture that isboth
comprehensive and flexible. Most importantly, the OSI model allows
completeinteroperability between otherwise incompatible systems.
Within a single machine, each layer calls upon the services of the layer just belowit.
Layer 3, for example, uses the services provided by layer 2 and provides services forlayer 4.
Between machines, layer x on one machine communicates with layer x onanother machine.
This communication is governed by an agreed-upon series of rulesand conventions called
protocols. The processes on each machine that communicate ata given layer are called peer-
to-peer processes. Communication between machines istherefore a peer-to-peer process
using the protocols appropriate to a given layer.

Peer-to-Peer Processes
At the physical layer, communication is direct: In Figure 5.2(a), device A sends a
streamof bits to device B (through intermediate nodes). At the higher layers, however,
communicationmust move down through the layers on device A, over to device B, and
thenback up through the layers. Each layer in the sending device adds its own informationto
the message it receives from the layer just above it and passes the whole package tothe
layer just below it.

Mr. P R Sali 2 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.2(a) The interaction between the layers


At layer 1 the entire package is converted to a form that can be transmitted to
thereceiving device. At the receiving machine, the message is unwrapped layer by layer,with
each process receiving and removing the data meant for it. For example, layer 2removes the
data meant for it, and then passes the rest to layer 3. Layer 3 then removes thedata meant
for it and passes the rest to layer 4, and so on.

Interfaces between Layers

The passing of the data and network information down through the layers of the
sendingdevice and back up through the layers of the receiving device is made possible byan
interface between each pair of adjacent layers. Each interface defines the informationand
services a layer must provide for the layer above it. Well-defined interfaces andlayer
functions provide modularity to a network. As long as a layer provides theexpected services
to the layer above it, the specific implementation of its functions canbe modified or
replaced without requiring changes to the surrounding layers.

Organization ofthe Layers

The seven layers can be thought of as belonging to three subgroups. Layers 1, 2,


and3-physical, data link, and network-are the network support layers; they deal withthe
physical aspects of moving data from one device to another (such as electricalspecifications,
physical connections, physical addressing, and transport timing andreliability). Layers 5, 6,
and 7-session, presentation, and application-can bethought of as the user support layers;
they allow interoperability among unrelatedsoftware systems. Layer 4, the transport layer,
links the two subgroups and ensuresthat what the lower layers have transmitted is in a form
that the upper layers can use.The upper OSI layers are almost always implemented in
software; lower layers are acombination of hardware and software, except for the physical
layer, which is mostlyhardware.
In Figure 5.2(b), which gives an overall view of the OSI layers, D7 means the dataunit
at layer 7, D6 means the data unit at layer 6, and so on. The process starts at layer7 (the
application layer), then moves from layer to layer in descending, sequentialorder. At each
layer, a header, or possibly a trailer,can be added to the data unit.Commonly, the trailer is
added only at layer 2. When the formatted data unit passesthrough the physical layer (layer
1), it is changed into an electromagnetic signal andtransported along a physical link.

Mr. P R Sali 3 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.2(b)An exchange using the OSI model

Upon reaching its destination, the signal passes into layer 1 and is transformedback into
digital form. The data units then move back up through the OSI layers. Aseach block of data
reaches the next higher layer, the headers and trailers attached to it atthe corresponding
sending layer are removed, and actions appropriate to that layer aretaken. By the time it
reaches layer 7, the message is again in a form appropriate to theapplication and is made
available to the recipient.

Encapsulation
Figure 5.2(b) reveals another aspect of data communications in the OSI model:
encapsulation. A packet (header and data) at level 7 is encapsulated in a packet at level 6.
The whole packet at level 6 is encapsulated in a packet at level 5, and so on.
In other words, the data portion of a packet at level N - 1 carries the whole packet
(data and header and maybe trailer) from level N. The concept is called encapsulation; level
N - 1 is not aware of which part of the encapsulated packet is data and which part is the
header or trailer. For level N - 1, the whole packet coming from level N is treated as one
integral unit.

5.2 LAYERS IN THE OSI MODEL

In this section we briefly describe the functions of each layer in the OSI model.

1.Physical Layer

The physical layer coordinates the functions required to transmit a bit stream over a
physical medium. It deals with the mechanical and electrical specifications of the interface
and transmission media. It also defines the procedures and functions that physical devices
Mr. P R Sali 4 DCC (22414)
SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

and interfaces have to perform for transmission to occur. Figure 5.3 shows the position of
the physical layer with respect to the transmission media and the data link layer.

Figure 5.3Physical layer

The major duties of the physical layer are as follows:

1. Physical characteristics of interfaces and media. The physical layer defines the
characteristics of the interface between the devices and the transmission media. It also
defines the type of transmission medium.

2. Representation of bits. The physical layer data consists of a stream of bits (sequence of
0s or 1s) without any interpretation. To be transmitted, bits must be encoded into signals:
electrical or optical. The physical layer defines the type of representation (how 0s and 1s are
changed to signals).

3. Data rate. The transmission rate-The number of bits sent each second is also defined by
the physical layer. In other words, the physical layer defines the duration of a bit, which is
how long it lasts.

4. Synchronization of bits. The sender and receiver not only must use the same bit rate but
also must be synchronized at the bit level. In other words, the sender and the receiver
clocks must be synchronized.

2.Data Link Layer

The data link layer transforms the physical layer, a raw transmission facility, to a
reliable link. It makes the physical layer appear error- free to the upper layer (network
layer). Figure 5.4 shows the relationship of the data link layer to the network and physical
layers.

Mr. P R Sali 5 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.4Data link layer

The data link layer is responsible for transmitting frames from one node to the next.

The major duties of the data link layer are as follows:

1. Framing. The data link layer divides the stream of bits received from the network layer
into manageable data units called frames.

2. Physical addressing. If frames are to be distributed to different systems on the network,


the data link layer adds a header to the frame to define the sender and/or receiver of the
frame. If the frame is intended for a system outside the sender's network, the receiver
address is the address of the connecting device that connects the network to the next one.

3. Flow control. If the rate at which the data are absorbed by the receiver is less than the
rate produced in the sender, the data link layer imposes a flow control mechanism to
prevent overwhelming the receiver.

4. Error control. The data link layer adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. It also uses a mechanism to
prevent duplication of frames. Error control is normally achieved through a trailer added to
the end of the frame.

5.Access control. When two or more devices are connected to the same link, data link layer
protocols are necessary to determine which device has control over the link at any given
time.

The bottom two OSI layers, the physical layer and the data-link layer, define how multiple
computers can use the network simultaneously without interfering witheach other.The
IEEE802 project incorporated the specifications in those two layers to create standardsthat
have defined the dominant LAN environments. Figure 5.5 shows the data-link layer and its
two sublayers.After deciding that more detail was needed at the data-link layer, the 802
standards committee divided the data-link layer into two sub-layers:

Mr. P R Sali 6 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

• Logical Link Control (LLC) Establishing and terminating links, controlling frame traffic,
sequencing frames, and acknowledging frames

• Media Access Control (MAC) Managing media access, delimiting frames, checking frame
errors, and recognizing frame addresses

Figure 5.5 Project 802 LLC and MAC sublayers

Logical Link Control (LLC) Sublayer

The LLC sub-layer manages data-link communication and defines the use of logical
interface points called service access points (SAP), Other computers can refer to and use
SAPs to transfer information from the LLC sub-layer to the upper OSI layers. Category 802.2
defines these standards.

Media Access Control (MAC) Sublayer

MAC sublayer is the lower of the two sublayers, providing shared access to the
physical layer for the computers' NICs. The MAC layer communicates directly with the NIC
and is responsible for delivering errorfree data between two computers on the network.

Categories 802.3, 802.4, 802.5, and 802.12 define standards for this sublayer and OSI layer
1, the physical layer.

Mr. P R Sali 7 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

LLC and MAC Standared

3.Network Layer

The network layer is responsible for the source-to-destination delivery of a packet


possibly across multiple networks. Whereas the data link layer oversees the delivery of the
packet between two systems on the same network, the network layer ensures that each
packet gets from its point of origin to its final destination.

If two systems are connected to the same link, there is usually no need for a network
layer. However, if the two systems are attached to different networks with connecting
devices between the networks, there is often a need for the network layer to accomplish
source-to-destination delivery. Figure 5.6 shows the relationship of the network layer to the
data link and transport layers.

Figure 5.6Network layer

The major duties of the network layer are as follows:

1.Logical addressing. The physical addressing implemented by the data link layer handles
the addressing problem locally. If a packet passes the network boundary, we need another
addressing system to help distinguish the source and destination systems. The network

Mr. P R Sali 8 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

layer adds a header to the packet coming from the upper layer that, among other things,
includes the logical addresses of the sender and receiver.

2. Routing. When independent networks or links are connected to create an internetwork


(network of networks) or a large network, the connecting devices (called routers or
switches) route or switch the packets to their final destination. One of the functions of the
network layer is to provide this mechanism.

4.Transport Layer

The transport layer is responsible for process-to-process delivery of the entire


message. Whereas the network layer oversees host-to-destination delivery of individual
packets, it does not recognize any relationship between those packets. It treats each one
independently, as though each piece belonged to a separate message, whether or not it
does. The transport layer, on the other hand, ensures that the whole message arrives intact
and in order, overseeing both error control and flow control at the process-to-process level.
Figure 5.7 shows the relationship of the transport layer to the network and session layers.

From Session layer To Session layer

Figure 5.7 Transport layer

The transport layer is responsible for delivery of a message from one process to another.

The major duties of the transport layer are as follows:

1. Port addressing. Computers often run several processes (running programs) at the same
time. For this reason, process-to-process delivery means delivery not only from one
computer to the next but also from a specific process on one computer to specific process
on the other. The transport layer header must therefore include type of address called a
port address. The network layer gets each packet to the correct computer; the transport
layer gets the entire message to the correct process on that computer.

Mr. P R Sali 9 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

2. Segmentation and reassembly. A message is divided into transmittable segments, each


segment containing a sequence number. These numbers enable the transport layer to
reassemble the message correctly upon arrival at the destination and to identify and replace
packets that were lost in the transmission.

3.Connection control. The transport layer can be either connectionless or


connectionoriented. A connectionless transport layer treats each segment as an
independent packet and delivers it to the transport layer at the destination machine. A
connectionoriented transport layer makes a connection with the transport layer at the
destination machine first before delivering the packets. After all the data are transferred,
the connection is terminated,

4. Flow control. Like the data link layer, the transport layer is responsible for flow control.
However, flow control at this layer is performed end to end rather than across a single link.

5. Error control. Like the data link layer, the transport layer is responsible for error control.
However, error control at this layer is performed end to end rather than across a single link.

5.Session Layer

The session layer is the network dialog controller. It establishes, maintains, and syn-
chronizes the interaction between communicating systems. Specific responsibilities of the
session layer include the following:

1. Dialog control. The session layer allows two systems to enter into a dialog. It allows the
communication between two processes to take place in either half-duplex (one way at a
time) or full-duplex (two ways at a time) mode. For example, the dialog between a terminal
connected to a mainframe can be half-duplex.
2. Synchronization. The session layer allows a process to add checkpoints (synchronization
points) into a stream of data. For example, if a system is sending a file of 2000 pages, it is
advisable to insert checkpoints after every 100 pages to ensure that each 100 page unit is
received and acknowledged independently. In this case, if a crash happens during the
transmission of page 523, the only pages that need to be resent after system recovery are
pages 501 to 523. Pages previous to 501 need not be resent. Figure 5.8 illustrates the
relationship of the session layer to the transport and presentation layers.

Mr. P R Sali 10 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.8Session layer

6.Presentation Layer

The presentation layer is concerned with the syntax and semantics of the
information exchanged between two systems. Figure 5.9 shows the relationship between
the presentation layer and the application and session layers.

Figure 5.9Presentation layer

Specific responsibilities of the presentation layer include the following:

1. Translation. The processes (running programs) in two Systems are usually exchanging
information in the form of character strings, numbers, and so on. The information must be
changed to bit streams before being transmitted. Because different computers use different
encoding systems, the presentation layer is responsible for interoperability between these
different encoding methods. The presentation layer at the sender changes the information
from its sender- dependent format into a common format. The presentation layer at the
receiving machine changes the common format into its receiver- dependent format.

Mr. P R Sali 11 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

2. Encryption. To carry sensitive information, a system must be able to ensure privacy.


Encryption means that the sender transforms the original information toanother form and
sends the resulting message out over the network. Decryptionreverses the original process
to transform the message back to its original form.

3.Compression. Data compression reduces the number of bits contained in the information.
Data compression becomes particularly important in the transmission of multimedia such as
text, audio, and video.

7.Application Layer

The application layer enables the user, whether human or software, to access the
network. It provides user interfaces and support for services such as electronic mail remote
file access and transfer, shared database management, and other types of distributed
information services.

Figure 5.10 shows the relationship of the application layer to the user and the presentation
layer. Of the many application services available, the figure shows only three: X.400
(message-handling services), X.500 (directory services), and file transfer, access, and
management (FTAM). The user in this example uses X.400 to send an email message.

Figure 5.10 Application layer

Specific services provided by the application layer include the following:

1.Network virtual terminal. A network virtual terminal is a software version of a physical


terminal and allows a user to log on to a remote host. To do so, the application creates a
software emulation of a terminal at the remote host. The user's computer talks to the
software terminal, which, in turn, talks to the host, and vice versa. The remote host believes
it is communicating with one of its own terminals and allows you to log on.

Mr. P R Sali 12 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

2. File transfer, access, and management (FTAM). This application allows a user to access
files in a remote host (to make changes or read data), to retrieve files from a remote
computer for use in the local computer, and to manage or control files in a remote
computer locally.

3.Mail services. This application provides the basis for email forwarding and storage.

4.Directory services. This application provides distributed database sources and access for
global information about various objects and services.

Protocols associated with application layer of OSI model are as follows:


1. TELNET
2. File Transfer Protocol (FTP)
3. Simple Mail Transfer Protocol (SMTP)
4. Domain Name System (DNS)
5. Hypertext Transfer Protocol (HTTP)

Mr. P R Sali 13 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

5.2 TCP/IP PROTOCOL SUITE

The ARPANET was a research network sponsored by the DoD (U.S. Department of Defense).
It eventually connected hundreds of universities and government installations, using leased
telephone lines. When satellite and radio networks were added later, the existing protocols
had trouble interworking with them, so a new reference architecture was needed. Thus, the
ability to connect multiple networks in a seamless way was one of the major design goals
from the very beginning. This architecture later became known as the TCP/IP Reference
Model, after its two primary protocols. It was first defined in (Cerf and Kahn, 1974).

The TCP/IP protocol suite was developed prior to the OSI model. Therefore, the layers
in the TCP/IP protocol suite do not exactly match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers: host-to-network, internet, transport, and
application. However, when TCP/IP is compared to OSI, we can say that the host-to-network
layer is equivalent to the combination of the physical and data link layers. The internet layer
is equivalent to the network layer, and the application layer is roughly doing the job of the
session, presentation, and application layers with the transport layer in TCP/IP taking care of
part of the duties of the session layer.

Mr. P R Sali 14 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.11 TCP/IP and OSI model

TCP/IP is a hierarchical protocol made up of interactive modules, each of which


provides a specific functionality; however, the modules are not necessarily interdependent.
Whereas the OSI model specifies which functions belong to each of its layers, the layers of
the TCP/IP protocol suite contain relatively independent protocols that can be mixed and
matched depending on the needs of the system. The term hierarchical means that each
upper-level protocol is supported by one or more lower-level protocols.
At the transport layer, TCP/IP defines three protocols: Transmission Control Protocol
(TCP), User Datagram Protocol (UDP), and Stream Control Transmission Protocol (SCTP). At
the network layer, the main protocol defined by TCP/IP is the Internetworking Protocol (IP);
there are also some other protocols that support data movement in this layer.

Physical and Data Link Layers


At the physical and data link layers, TCPIIP does not define any specific protocol. It
supports all the standard and proprietary protocols. A network in a TCPIIP internetwork can
be a local-area network or a wide-area network.

Network Layer
At the network layer (or, more accurately, the internetwork layer), TCP/IP supports
the Internetworking Protocol. IP, in turn, uses four supporting protocols: ARP, RARP, ICMP,
and IGMP.

Internetworking Protocol (IP)


The Internetworking Protocol (IP) is the transmission mechanism used by the TCP/IP
protocols. It is an unreliable and connectionless protocol-a best-effort delivery service. The
term best effort means that IP provides no error checking or tracking. IP assumes the
Mr. P R Sali 15 DCC (22414)
SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

unreliability of the underlying layers and does its best to get a transmission through to its
destination, but with no guarantees.
IP transports data in packet called datagram, each of which is transported separately.
Datagram can travel along different routes and can arrive out of sequence or be duplicated.
IP does not keep track of the routes and has no facility for reordering datagram once they
arrive at their destination.
The limited functionality of IP should not be considered a weakness, however. IP
provides bare-bones transmission functions that free the user to add only those facilities
necessary for a given application and thereby allows for maximum efficiency.

Address Resolution Protocol


The Address Resolution Protocol (ARP) is used to associate a logical address with a
physical address. On a typical physical network, such as a LAN, each device on a link is
identified by a physical or station address, usually imprinted on the network interface card
(NIC). ARP is used to find the physical address of the node when its Internet address is
known.
Reverse Address Resolution Protocol
The Reverse Address Resolution Protocol (RARP) allows a host to discover its Internet
address when it knows only its physical address. It is used when a computer is connected to
a network for the first time or when a diskless computer is booted.

Internet Control Message Protocol


The Internet Control Message Protocol (ICMP) is a mechanism used by hosts and
gateways to send notification of datagram problems back to the sender. ICMP sends query
and error reporting messages.

Internet Group Message Protocol


The Internet Group Message Protocol (IGMP) is used to facilitate the simultaneous
transmission of a message to a group of recipients.

Transport Layer
Traditionally the transport layer was represented in TCP/IP by two protocols: TCP and
UDP. IP is a host-to-host protocol, meaning that it can deliver a packet from one physical
device to another. UDP and TCP are transport level protocols responsible for delivery of a
message from a process (running program) to another process. A new transport layer
protocol, SCTP, has been devised to meet the needs of some newer applications.

Mr. P R Sali 16 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

User Datagram Protocol


The User Datagram Protocol (UDP) is the simpler of the two standard TCPIIP transport
protocols. It is a process-to-process protocol that adds only port addresses, checksum error
control, and length information to the data from the upper layer.

Transmission Control Protocol


The Transmission Control Protocol (TCP) provides full transport-layer services to
applications. TCP is a reliable stream transport protocol. The term stream, in this context,
means connection-oriented: A connection must be established between both ends of a
transmission before either can transmit data.
At the sending end of each transmission, TCP divides a stream of data into smaller
units called segments. Each segment includes a sequence number for reordering after
receipt, together with an acknowledgment number for the segments received. Segments
are carried across the internet inside of IP datagram. At the receiving end, TCP collects each
datagram as it comes in and reorders the transmission based on sequence numbers.

Stream Control Transmission Protocol


The Stream Control Transmission Protocol (SCTP) provides support for newer
applications such as voice over the Internet. It is a transport layer protocol that combines
the best features of UDP and TCP.

Application Layer
The application layer in TCPIIP is equivalent to the combined session, presentation,
and application layers in the OSI model. Many protocols are defined at this layer.
Communication at the network layer is host-to-host (computer-to-computer); a computer
somewhere in the world needs to communicate with another computer somewhere else in
the world. Usually, computers communicate through the Internet. The packet transmitted
by the sending computer may pass through several LANs or WANs before reaching the
destination computer. For this level of communication, we need a global addressing
scheme; we called this as logical addressing. Today, we use the term IP address to mean a
logical address in the network layer of the TCP/IP protocol suite.
The Internet addresses are 32 bits in length; this gives us a maximum of 232
addresses. These addresses are referred to as IPv4 (IP version 4) addresses or simply IP
addresses if there is no confusion. The need for more addresses, in addition to other
concerns about the IP layer, motivated a new design of the IP layer called the new
generation of IP or IPv6 (IP version 6).In this version, the Internet uses 128-bit addresses
that give much greater flexibility in address allocation. These addresses are referred to as
IPv6 (IP version 6) addresses.

Mr. P R Sali 17 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Address mapping:

Internet Protocol (IP) as the main protocol at the network layer. IP was designed as a
best-effort delivery protocol, but it lacks some features such as flow control and error
control. It is a host-to-host protocol using logical addressing. To make IP more responsive to
some requirements in today's internetworking, we need the help of other protocols.
We need protocols to create a mapping between physical and logical addresses. IP
packets use logical (host-to-host) addresses. These packets, however, need to be
encapsulated in a frame, which needs physical addresses (node-to-node). We will see that a
protocol called ARP, the Address Resolution Protocol, is designed for this purpose. We
sometimes need reverse mapping-mapping a physical address to a logical address. For
example, when booting a diskless network or leasing an IP address to a host. Three
protocols are designed for this purpose: RARP, BOOTP, and DHCP. Lack of flow and error
control in the Internet Protocol has resulted in another protocol, ICMP that provides alerts.
It reports congestion and some types of errors in the network or destination host.
IP was originally designed for unicast delivery, one source to one destination. As the
Internet has evolved, the need for multicast delivery, one source to many destinations, has
increased tremendously. IGMP gives IP a multicast capability.

Mapping Logical to Physical Address: ARP


Anytime a host or a router has an IP datagram to send to another host or router, it
has the logical (IP) address of the receiver. The logical (IP) address is obtained from the DNS
if the sender is the host or it is found in a routing table if the sender is a router. But the IP
datagram must be encapsulated in a frame to be able to pass through the physical network.
This means that the sender needs the physical address of the receiver. The host or the
router sends an ARP query packet. The packet includes the physical and IP addresses of the
sender and the IP address of the receiver. Because the sender does not know the physical
address of the receiver, the query is broadcast over the network (see Figure 5.12).
Every host or router on the network receives and processes the ARP query packet, but
only the intended recipient recognizes its IP address and sends back an ARP response
packet. The response packet contains the recipient's IP and physical addresses. The packet is
unicast directly to the inquirer by using the physical address received in the query packet.

Mr. P R Sali 18 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.12 ARP operation

In Figure 5.12 a, the system on the left (A) has a packet that needs to be delivered to
another system (B) with IP address 141.23.56.23. System A needs to pass the packet to its
data link layer for the actual delivery, but it does not know the physical address of the
recipient. It uses the services of ARP by asking the ARP protocol to send a broadcast ARP
request packet to ask for the physical address of a system with an IF address of
141.23.56.23.
This packet is received by every system on the physical network, but only system B
will answer it. Now system A can send all the packets it has for this destination by using the
physical address it received.

Operation
Let us see how ARP functions on a typical internet. First we describe the steps
involved. we discuss the four cases in which a host or router needs to use ARP. These are
the steps involved in an ARP process:
1. The sender knows the IP address of the target. We will see how the sender obtains
this shortly.
2. IP asks ARP to create an ARP request message, filling in the sender physical
address, the sender IP address, and the target IP address. The target physical address field is
filled with Os.
3. The message is passed to the data link layer where it is encapsulated in a frame by
using the physical address of the sender as the source address and the physical broadcast
address as the destination address.
4. Every host or router receives the frame. Because the frame contains a broadcast
destination address, all stations remove the message and pass it to ARP. All machines except
the one targeted drop the packet. The target machine recognizes its IP address.
Mr. P R Sali 19 DCC (22414)
SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

5. The target machine replies with an ARP reply message that contains its physical
address. The message is unicast.
6. The sender receives the reply message. It now knows the physical address of the
target machine.
7. The IP datagram, which carries data for the target machine, is now encapsulated in
a frame and is unicast to the destination.

Mapping Physical to Logical Address: RARP, BOOTP, and DHCP


There are occasions in which a host knows its physical address, but needs to know its
logical address. This may happen in two cases:
1. A diskless station is just booted. The station can find its physical address by
checking its interface, but it does not know its IP address.
2. An organization does not have enough IP addresses to assign to each station; it
needs to assign IP addresses on demand. The station can send its physical address and ask
for a short time lease.

RARP
Reverse Address Resolution Protocol (RARP) finds the logical address for a machine
that knows only its physical address. Each host or router is assigned one or more logical(IP)
addresses, which are unique and independent of the physical (hardware) address of the
machine. To create an IP datagram, a host or a router needs to know its own IP address or
addresses. The IP address of a machine is usually read from its configuration file stored on a
disk file. However, a diskless machine is usually booted from ROM, which has minimum
booting information. The ROM is installed by the manufacturer. It cannot include the IP
address because the IP addresses on a network are assigned by the network administrator.
The machine can get its physical address (by reading its NIC, for example), which is unique
locally. It can then use the physical address to get the logical address by using the RARP
protocol. A RARP request is created and broadcast on the local network. Another machine
on the local network that knows all the IP addresses will respond with a RARP reply. The
requesting machine must be running a RARP client program; the responding machine must
be running a RARP server program. There is a serious problem with RARP: Broadcasting is
done at the data link layer. The physical broadcast address, allis in the case of Ethernet,
does not pass the boundaries of a network. This means that if an administrator has several
networks or several subnets, it needs to assign a RARP server for each network or subnet.
This is the reason that RARP is almost obsolete. Two protocols, BOOTP and DHCP, are
replacing RARP.

Mr. P R Sali 20 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

DHCP (Dynamic Host Configuration Protocol) is a client-server protocol that uses DHCP
servers and DHCP clients. A DHCP server is a machine that runs a service that can lease out
IP addresses and other TCP/IP information to any client that requests them. The DHCP
server typically has a pool of IP addresses that it is allowed to distribute to clients, and these
clients lease an IP address from the pool for a specific period of time, usually several days.
Once the lease is ready to expire, the client contacts the server to arrange for renewal.
DHCP clients are client machines that run special DHCP client software enabling them to
communicate with DHCP server.

DHCP clients obtain a DHCP lease for an IP address, a subnet mask, and various DHCP
options from DHCP servers in a four-step process:

DHCP DISCOVER: The client broadcasts a request for a DHCP server.


DHCPOFFER: DHCP servers on the network offer an address to the client.
DHCPREQUEST: The client broadcasts a request to lease an address from one of the offering
DHCP servers.
DHCPACK: The DHCP server that the client responds to acknowledges the client, assigns it
any configured DHCP options, and updates its DHCP database. The client then initializes and
binds its TCP/IP protocol stack and can begin network communication.

5.3 IPv4 ADDRESSES


An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device (for example, a computer or a router) to the Internet.IPv4 addresses
is unique. They are unique in the sense that each address defines one, and only one,
connection to the Internet. Two devices on the Internet can never have the same address at
the same time. We will see later that, by using some strategies, an address may be assigned
to a device for a time period and then taken away and assigned to another device.
On the other hand, if a device operating at the network layer has m connections to
the Internet, it needs to have m addresses. We will see later that a router is such a device.
The IPv4 addresses are universal in the sense that the addressing system must be
accepted by any host that wants to be connected to the Internet.

Mr. P R Sali 21 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Notations
There are two prevalent notations to show an IPv4 address: binary notation and
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. So it is common to hear an IPv4 address referred to as a 32-bit address or a4-
byte address. The following is an example of an IPv4 address in binary notation:
0111010110010101 0001110100000010

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. The
following is the dotted decimal notation of the above address:
117.149.29.2
Figure 5.13 shows an IPv4 address in both binary and dotted-decimal notation.

Figure 5.13 Dotted-decimal notation and binary notation of an IPv4 address

Note that because each byte (octet) is 8 bits, each number in dotted-decimal notation
is a value ranging from 0 to 255.

Classful Addressing
IPv4 addressing, at its inception, used the concept of classes. This architecture is
called classful addressing. Although this scheme is becoming obsolete, we briefly discuss it
here to show the rationale behind classless addressing.
In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
Each class occupies some part of the address space.
We can find the class of an address when given the address in binary notation or
dotted-decimal notation. If the address is given in binary notation, the first few bits can
immediately tell us the class of the address. If the address is given in decimal-dotted
notation, the first byte defines the class. Both methods are shown in Figure 5.14

Mr. P R Sali 22 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Figure 5.14 IPv4 Classes

The Internet community originally defined five address classes to accommodate networks of
varying sizes. Microsoft TCP/IP supports class A, B, and C addresses assigned to hosts. The
class of address defines which bits are used for the network ID and which bits are used for
the host ID. It also defines the possible number of networks and the number of hosts per
network.

1) Class A
Class A addresses are assigned to networks with a very large number of hosts. The high-
order bit in a class A address is always set to zero. The next seven bits complete the network
ID. The remaining 24 bits (the last three octets) represent the host ID. This allows for 126
networks and 16,777,214 hosts per network. Figure illustrates the structure of class A
addresses.

2) Class B
Class B addresses are assigned to medium-sized to large-sized networks. The two high-order
bits in a class B address are always set to binary 1 0. The next 14 bits complete the network
ID. The remaining 16 bits represent the host ID. This allows for 16,384 networks and 65,534
hosts per network. Figure illustrates the structure of class B addresses.

Mr. P R Sali 23 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

3) Class C
Class C addresses are used for small networks. The three high-order bits in a class C address
are always set to binary 1 1 0. The next 21 bits complete the network ID. The remaining 8
bits (last octet) represent the host ID. This allows for 2,097,152 networks and 254 hosts per
network. Figure illustrates the structure of class C addresses.

4) Class D
Class D addresses are reserved for IP multicast addresses. The four high-order bits in a class
D address are always set to binary 1 1 1 0. The remaining bits are for the address that
interested hosts recognize. Microsoft supports class D addresses for applications to
multicast data to multicast-capable hosts on an internetwork.
5) Class E
Class E is an experimental address that is reserved for future use. The high-order bits in a
class E address are set to 1111.

Example Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is O. This is a class A address.
b. The first 2 bits are 1; the third bit is O. 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.

List any four IP functions.

1. Addressing: In order to perform the job of delivering datagrams, IP must know where to
deliver them to. For this reason, IP includes a mechanism for host addressing. Furthermore,
since IP operates over internetworks, its system is designed to allow unique addressing of
devices across arbitrarily large networks. It also contains a structure to facilitate the routing
of datagrams to distant networks if that is required.

Mr. P R Sali 24 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

2. Data Encapsulation and Formatting/Packaging: IP accepts data from the transport layer
protocols UDP and TCP. It then encapsulates this data into an IP datagram using a special
format prior to transmission.
3. Fragmentation and Reassembly: IP datagrams are passed down to the data link layer for
transmission on the local network. However, the maximum frame size of each
physical/data-link network using IP may be different. For this reason, IP includes the ability
to fragment IP datagrams into pieces so they can each be carried on the local network. The
receiving device uses the reassembly function to recreate the whole IP datagram again.

4. Routing / Indirect Delivery: When an IP datagram must be sent to a destination on the


same local network, this can be done easily using the network's underlying
LAN/WLAN/WAN protocol using what is sometimes called direct delivery. However, in many
(if not most cases) the final destination is on a distant network not directly attached to the
source. In this situation the datagram must be delivered indirectly. This is accomplished by
routing the datagram through intermediate devices.

IPv4 IPv6
1. Source and destination 1. Source and destination
addressesare32 bits (4 bytes) in addresses are 128 bits(16 bytes)in
length. length.
2. Uses broadcast addresses to 2. There arenoIPv6 broadcast
send traffic to all nodes on a addresses. Instead, multicast
subnet. scoped addresses are used.
3. Fragmentation is supported at 3. Fragmentation is not supported
Originating hosts and intermediate at routers. It is only supported at
routers. the originating host.
4. IP header includes a checksum. 4. IP header does not include a
checksum.
5. IP header includes options. 5. All optional data is moved
toIPv6 extension headers.
6.IPsec support is optional 6.IPsec support Is required in a
fullIPv6 implementation.
7. No identification of payload for 7. Payload identification for QoS
QoS Handling by routers is present handling By routers is included in
within the IPv4 header. theIPv6 header using the Flow
Label field.
8.Address must be configured 8.Addresses can be automatically
either manually or through DHCP assigned using stateless address
auto configuration, assigned using
DHCP, or manually configured.
9. IP address represented in 9. IP address is represented in
decimal number system hexadecimal number system
10. ‘.’used as separator. 10. ‘ :’ used as separator.
Mr. P R Sali 25 DCC (22414)
SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Connectionless Versus Connection-Oriented Service


A transport layer protocol can either be connectionless or connection-oriented.
Connectionless Service
In a connectionless service, the packets are sent from one party to another with no
need for connection establishment or connection release. The packets are not numbered;
they may be delayed or lost or may arrive out of sequence. There is no acknowledgment
either. We will see shortly that one of the transport layer protocols in the Internet model,
UDP, is connectionless.

Connection-Oriented Service
In a connection-oriented service, a connection is first established between the sender
and the receiver. Data are transferred. At the end, the connection is released. We will see
shortly that TCP and SCTP are connection-oriented protocols.

Reliable Versus Unreliable


The transport layer service can be reliable or unreliable. If the application layer
program needs reliability, we use a reliable transport layer protocol by implementing flow
and error control at the transport layer. This means a slower and more complex service. On
the other hand, if the application program does not need reliability because it uses its own
flow and error control mechanism or it needs fast service or the nature of the service does
not demand flow and error control (real-time applications), then an unreliable protocol can
be used.

Compare UDP and TCP

TCP UDP
1. TCP is connection oriented 1. UDP is connection less protocol
protocol
2. It provides reliable delivery of 2. It provides unreliable delivery of
messages messages
3. It assigns datagram size 3. Every datagram segment is of
dynamically for efficiency. the same size.
4. TCP has flow control 4. UDP has no flow control
5. Overhead is low 5. Overhead is very low.
6. Transmission speed is high 6. Transmission speed is very high

Mr. P R Sali 26 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Connectionless and connection oriented protocol.

Connection less protocol: These protocols do not establish a connection between devices. It
is manually achieved by transmitting information in one direction, from source to
destination without checking to see if the destination is still there or if it is prepared to
receive the information.
Connection-oriented protocol: It means that when devices communication they perform
hand sharing to set up on end to end connection. Usually one device begins by sending a
request to open a connection, and the other responds.

Connectionless protocols: 1) IP 2) ICMP 3) UDP

1. IP
IP is internet Protocol.
It is unreliable protocol because it does not provide any error control and flow control.
Packets in IP are called “Datagram”

2. ICMP
It is internet control message protocol.
It reports error and sends control messages.
Error reporting messages include – destination unreachable, source quench, time exceed,
parameter problem, redirection etc.
Query message includes –echo request and reply, time stamp request and reply, router
solicitation and advertisement etc.

3.UDP
UDP is user datagram protocol.
It is connectionless protocol because data is sent without establishing a connection between
sender and receiver before sending the data.
UDP is unreliable because data is delivered without acknowledgement.
UDP does not perform Auto retransmission.
UDP does not use flow control.

UDP has high transmission speed.

Mr. P R Sali 27 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

Connection oriented protocol:

1) TCP 2) SLIP 3) PPP 4) SMTP

1) TCP
TCP is transmission control protocol.
It is connection oriented protocol because connection must be established prior to
transmission of data.
TCP is reliable protocol because data is delivered with acknowledgement.
TCP perform Auto Retransmission if the data is lost.
TCP use flow control.
TCP has low speed of transmission.

2. SLIP
SLIP is serial line internet protocol
SLIP does not perform error detection and correction.
SLIP does not provide any authentication.
SLIP is not approved internet standard.
SLIP supports only Internet protocol (IP)
SLIP supports static IP address assignment

3. PPP
PPP is point to point protocol.
PPP perform error detection
PPP provides authentication and security.
PPP is approved internet standard.
PPP supports IP and other protocols.
PPP supports Dynamic IP address assignment

4. SMTP
SMTP is simple mail transfer protocol.
It is connection oriented text based protocol in which sender communicates with receiver
using a command and supplying data over reliable TCP connection.
SMTP is standard application layer protocol for delivery of email over TCP/IP network.
SMTP establishes a TCP connection between sender and port number 25 of receiver.

Mr. P R Sali 28 DCC (22414)


SNJB’S Shri HHJB Polytechnic, Chandwad

CH.5 Reference Models

OSI reference model TCP/IP network model


1)It has 7 layers 1)It has 4 layers
2)Transport layer guarantees 2)Transport layer does not
delivery of packets guarantees delivery of packets
3)Horizontal approach 3)Vertical approach
4)Separate presentation layer 4)No session layer,
characteristics are provided by
transport layer
5)Separate session layer 5)No presentation layer,
characteristics are provided by
application layer
6)Network layer provides both 6)Network layer provides only
connectionless and connection connection less services
oriented services
7)It defines the services, 7)It does not clearly distinguishes
interfaces and protocols very between service interface and
clearly and makes a clear protocols
distinction between them
8)The protocol are better hidden 8)It is not easy to replace the
and can be easily replaced as the protocols
technology changes
9)OSI truly is a general model 9)TCP/IP cannot be used for any
other application
10)It has a problem of protocol 10)The model does not fit any
filtering into a model protocol stack.

Mr. P R Sali 29 DCC (22414)

You might also like