OSI Model From Layer 1 to Layer 3
OSI Model From Layer 1 to Layer 3
OSI Model From Layer 1 to Layer 3
OSI Model
Created at a time when network computing was in its infancy, the OSI was published in 1984 by the
International Organization for Standardization (ISO). Though it does not always map directly to specific
systems, the OSI Model is still used today as a means to describe Network Architecture.
The OSI has been design to work over a 7-layer model flow. Each layer interact with each other to
provide final results as expected.
Please find a reference of the 7 different layers that compose the OSI model on the following chart:
Following are the various functions performed by the Physical layer of the OSI model.
into signals for transmission. It defines the type of encoding i.e. how 0's and 1's are changed to
signal.
2. Data Rate: This layer defines the rate of transmission which is the number of bits per second.
3. Synchronization: It deals with the synchronization of the transmitter and receiver. The sender
4. Interface: The physical layer defines the transmission interface between devices and
transmission medium.
5. Line Configuration: This layer connects devices with the medium: Point to Point configuration
6. Topologies: Devices must be connected using the following topologies: Mesh, Star, Ring and Bus.
7. Transmission Modes: Physical Layer defines the direction of transmission between two devices:
The uppermost sublayer, LLC, multiplexes protocols running at the top of data link layer, and optionally
provides flow control, acknowledgment, and error notification. The LLC provides addressing and control
of the data link. It specifies which mechanisms are to be used for addressing stations over the
transmission medium and for controlling the data exchanged between the originator and recipient
machines.
MAC may refer to the sublayer that determines who is allowed to access the media at any one time
(e.g. CSMA/CD). Other times it refers to a frame structure delivered based on MAC addresses inside.
There are generally two forms of media access control: distributed and centralized. Both of these may
be compared to communication between people. In a network made up of people speaking, i.e. a
conversation, they will each pause a random amount of time and then attempt to speak again,
effectively establishing a long and elaborate game of saying "no, you first".
As with each of the OSI layers, there are terms specific to this layer:
Node - The Layer 2 notation for network devices connected to a common medium
Media/medium (physical)* - The physical means for the transfer of information between two nodes
* It is important to understand the meaning of the words medium and media within the context of this
chapter. Here, these words refer to the material that actually carries the signals representing the
transmitted data. Media is the physical copper cable, optical fiber, or atmosphere through which the
signals travel. In this chapter media does not refer to content programming such as audio, animation,
television, and video as used when referring to digital content and multimedia.
** A physical network is different from a logical network. Logical networks are defined at the Network
layer by the arrangement of the hierarchical addressing scheme. Physical networks represent the
interconnection of devices on a common media. Sometimes, a physical network is also referred to as a
network segment.
Creating a frame
The Data Link layer prepares a packet for transport across the local media by encapsulating it with a
header and a trailer to create a frame. Unlike the other PDUs that have been discussed in this course,
the Data Link layer frame includes:
Layer 2 header
The frame header contains the control information specified by the Data Link layer protocol for the
specific logical topology and media used. Frame control information is unique to each type of protocol.
It is used by the Layer 2 protocol to provide features demanded by the communication environment.
The Network layer, or OSI Layer 3, provides services to exchange the individual pieces of data over the
network between identified end devices.
*Structuring and managing multimode network, including addressing, routing and traffic control*
Addressing: the Network layer must provide a mechanism for addressing these end devices. If
individual pieces of data are to be directed to an end device, that device must have a unique
address. In an IPv4 network, when this address is added to a device, the device is then referred
to as a host.
Encapsulation: the Network layer must provide encapsulation. Not only must the devices be
identified with an address, the individual pieces - the Network layer PDUs - must also contain
these addresses. During the encapsulation process, Layer 3 receives the Layer 4 PDU and adds a
Layer 3 header, or label, to create the Layer 3 PDU. When referring to the Network layer, we call
this PDU a packet. When a packet is created, the header must contain, among other information,
the address of the host to which it is being sent. This address is referred to as the destination
address. The Layer 3 header also contains the address of the originating host. This address is
called the source address. After the Network layer completes its encapsulation process, the
packet is sent down to the Data Link layer to be prepared for transportation over the media.
Routing: the Network layer must provide services to direct these packets to their destination
host. The source and destination hosts are not always connected to the same network. In fact,
the packet might have to travel through many different networks. Along the way, each packet
must be guided through the network to reach its final destination. Intermediary devices that
connect the networks are called routers. The role of the router is to select paths for and direct
packets toward their destination. This process is known as routing. During the routing through
an internetwork, the packet may traverse many intermediary devices. Each route that a packet
takes to reach the next device is called a hop. As the packet is forwarded, its contents (the
Transport layer PDU), remain intact until the destination host is reached.
Decapsulation: the packet arrives at the destination host and is processed at Layer 3. The host
examines the destination address to verify that the packet was addressed to this device. If the
address is correct, the packet is decapsulated by the Network layer and the Layer 4 PDU
contained in the packet is passed up to the appropriate service at Transport layer. Unlike the
Transport layer (OSI Layer 4), which manages the data transport between the processes running
on each end host, Network layer protocols specify the packet structure and processing used to
carry the data from one host to another host. Operating without regard to the application data
carried in each packet allows the Network layer to carry packets for multiple types of
communications between multiple hosts.
Routing protocols are the means by which routers exchange next hop reachability through destinations
while routed protocols are the traffic that routers direct from source to destination using the routing
protocols.
IP
IP has the task of delivering packets from the source host to the destination host solely based on the IP
addresses in the packet headers. For this purpose, IP defines packet structures that encapsulate the data
to be delivered. It also defines addressing methods that are used to label the datagram with source and
destination information.
IPv4
IPv4 is a connectionless protocol, and operates on a best effort delivery model, in that it does not
guarantee delivery, nor does it assure proper sequencing or avoidance of duplicate delivery. These
aspects, including data integrity, are addressed by an upper layer transport protocol, such as the
Transmission Control Protocol (TCP).
IPv4 uses 32-bit addresses which limits the address space to 4294967296 (232) addresses.
IPv6
IPv6 provides other technical benefits in addition to a larger addressing space. In particular, it permits
hierarchical address allocation methods that facilitate route aggregation across the Internet, and thus
limit the expansion of routing tables. The use of multicast addressing is expanded and simplified, and
provides additional optimization for the delivery of services. Device mobility, security, and configuration
aspects have been considered in the design of the protocol.
IPv6 addresses are represented as eight groups, separated by colons, of four hexadecimal digits.
IP v4 Packet Header
An IPv4 protocol defines many different fields in the packet header. These fields contain binary values
that the IPv4 services reference as they forward packets across the network.
Fields:
IP Source Address
IP Destination Address
Time-to-Live (TTL)
Type-of-Service (ToS)
The IP Destination Address field contains a 32-bit binary value that represents the packet destination
Network layer host address.
IP Source Address
The IP Source Address field contains a 32-bit binary value that represents the packet source Network
layer host address.
Time-to-Live
The Time-to-Live (TTL) is an 8-bit binary value that indicates the remaining "life" of the packet. The TTL
value is decreased by at least one each time the packet is processed by a router (that is, each hop).
When the value becomes zero, the router discards or drops the packet and it is removed from the
network data flow. This mechanism prevents packets that cannot reach their destination from being
forwarded indefinitely between routers in a routing loop. If routing loops were permitted to continue,
the network would become congested with data packets that will never reach their destination.
Decrementing the TTL value at each hop ensures that it eventually becomes zero and that the packet
with the expired TTL field will be dropped.
Protocol
This 8-bit binary value indicates the data payload type that the packet is carrying. The Protocol field
enables the Network layer to pass the data to the appropriate upper-layer protocol.
01 ICMP
06 TCP
17 UDP
Type-of-Service
The Type-of-Service field contains an 8-bit binary value that is used to determine the priority of each
packet. This value enables a Quality-of-Service (QoS) mechanism to be applied to high priority packets,
such as those carrying telephony voice data. The router processing the packets can be configured to
decide which packet it is to forward first based on the Type-of-Service value.
Fragment Offset
A router may have to fragment a packet when forwarding it from one medium to another medium that
has a smaller MTU. When fragmentation occurs, the IPv4 packet uses the Fragment Offset field and the
The More Fragments (MF) flag is a single bit in the Flag field used with the Fragment Offset for the
fragmentation and reconstruction of packets. The More Fragments flag bit is set, it means that it is not
the last fragment of a packet. When a receiving host sees a packet arrive with the MF = 1, it examines
the Fragment Offset to see where this fragment is to be placed in the reconstructed packet. When a
receiving host receives a frame with the MF = 0 and a non-zero value in the Fragment offset, it places
that fragment as the last part of the reconstructed packet. An unfragmented packet has all zero
fragmentation information (MF = 0, fragment offset =0).
The Don't Fragment (DF) flag is a single bit in the Flag field that indicates that fragmentation of the
packet is not allowed. If the Don't Fragment flag bit is set, then fragmentation of this packet is NOT
permitted. If a router needs to fragment a packet to allow it to be passed downward to the Data Link
layer but the DF bit is set to 1, then the router will discard this packet.
Other fields:
Packet Length - This field gives the entire packet size, including header and data, in bytes.
Identification - This field is primarily used for uniquely identifying fragments of an original IP packet.
Header Checksum - The checksum field is used for error checking the packet header.
Options - There is provision for additional fields in the IPv4 header to provide other services, but these
are rarely used.
IP classes
Class A: The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1
– 127. Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A addressing
can have 126 networks (27-2) and 16777214 hosts (224-2).
Class B: An IP address which belongs to class B has the first two bits in the first octet set to 10.