OSI Model Vs TCP-IP Model
OSI Model Vs TCP-IP Model
Contents hide
Chapter 1: The OSI Model vs TCP IP Models
The OSI Reference Model
Protocols
OSI Application Layer
OSI Presentation Layer
OSI Session Layer
:
OSI Transport Layer
OSI Network Layer
OSI Data Link Layer
OSI Physical Layer
Encapsulation
TCP/IP Protocol Suite
TCP/IP Application Layer
TCP/IP Transport Layer
TCP/IP Internet Layer
TCP/IP Network Access Layer
Traffic Analysis
Traffic Analysis – Physical Layer
Traffic Analysis – Data Link Layer
Traffic Analysis – Network Access Layer
Traffic Analysis – Transport Layer
Traffic Analysis – Application Layer
Summary
OSI Layers
Layer 7 Application
Layer 6 Presentation
Layer 5 Session
Layer 4 Transport
Layer 3 Network
Protocols
The Presentation Layer is Layer 6 and it makes sure that the data
is understandable to the end-system. In other words, the data
must be converted and formatted in such a way that the system
recognizes it and knows how to treat it. This includes the
translation and conversion of details like formatting, compression
schemes, encryption schemes, and character representation
formats (e.g., ASCII to Unicode).
The middle stack layer, the Transport Layer (Layer 4), accepts
data from the Session Layer and breaks it up into transport
segments. The Transport Layer is responsible for the information
reaching the destination device in an error-free fashion and in the
proper order (i.e., the correct sequence of packets), utilizing the
following features to accomplish this task:
Reliability
Transmission error checking
Error correction
Data retransmission
Flow control
Sequencing
Data multiplexing
The following two protocols in the Transport Layer are used on the
Internet:
Encapsulation
:
In both LANs and WANs, packet transmission can be analyzed
using the seven-layer OSI reference model. When data is
transmitted by the source toward a specific destination, it passes
through the Application, Presentation, and Session Layers and the
PDU arrives at Layer 4 (Transport Layer).
The process of sending data down the protocol stack (from the
Application Layer to the Physical Layer) is called encapsulation.
The upper layer sends data down to the next level, which adds its
own specific information (using a header and a trailer) before
sending it down to the next layer where the process is repeated,
making the message bigger at each layer. The opposite process is
called decapsulation, in which the destination device receives the
message and moves it up the protocol stack to the Application
Layer. As the message travels through the layers, each layer
removes the lower layer’s additional information (i.e., header and
trailer), making the message smaller as it goes up the protocol
stack.
Application Layer
Transport Layer
Internet Layer
Data Link Layer
Physical Layer
Both the TCP/IP Transport Layer and the Internet Layer display
considerable differences when compared with the corresponding
OSI layers. The Transport Layer is based on two protocols:
The TCP and UDP protocol data units are segments, and each
segment contains a number of fields that carry different
information about the data, as shown in Figure 1.5 below:
The TCP header is larger than the UDP header because extra
fields are needed to ensure a reliable connection.
:
Port numbers can have values up to 65535. Most of the common
applications are assigned well-known port numbers, which are 0
to 1023. Port numbers 1024 through 49151 are registered port
numbers, and the range of 49152 to 65535 defines dynamic port
numbers (automatically assigned by network devices). Port
numbers are used to distinguish applications running on the same
device. Examples of well-known port numbers include the
following:
During the window size negotiation phase, the remote host learns
the number of bytes a device will accept before it must send an
ACK. The window sizes of the two endpoints may not match, so
negotiation must take place. In Figure 1.6, Host A has a window
size of 2 and Host B has a window size of 3. When Host A sends
data, it can send 3 bytes before waiting for an ACK, while Host B
can send only 2 bytes before receiving an ACK.
Note: The Window Size field specifies the number of bytes (octets)
a device will accept, not the number of segments.
After all the data has been sent between the two hosts during the
data transmission phase, the session closing phase begins. Host
A sends a segment with a FIN bit set, letting Host B know that it
wants to end the TCP session. This segment includes the
sequence number Host B is using at that specific moment, which
is 341. Host B acknowledges the request and sends an ACK bit
set with an acknowledgement number of 342 to confirm that it
received acknowledgement number 341. This segment also
includes the current sequence number of Host B, which is 125.
Host B sends a new segment with a FIN bit set, announcing that
the application it is running also requests an end to the session. In
the last step before the session is closed, Host A sends an ACK
segment with the number 126 to confirm that it received number
125 from Host B.
Traffic Analysis
The Data Link Layer presented in Figure 1.10 above shows the
following important Layer 2 (Ethernet in this case) information:
:
Destination device MAC address (Layer 2 address):
00:ff:58:fd:fa:0b (FTP server)
Source device MAC address (Layer 2 address):
00:ff:57:fd:fa:0b (FTP client)
EtherType: 0x0800, indicates which protocol is encapsulated
in the payload of the Ethernet Frame (IPv4 in this case)
Note: Port numbers are assigned by the Session Layer when the
transmission parameters are negotiated to ensure that the data goes
to the proper application on the destination device.
Summary
The OSI reference model and the TCP/IP protocol suite were
defined in order to understand the structure and the processes
that make a network function. While the OSI reference model is
beneficial for describing how network communications occur, it
represents more of a theoretical approach, unlike the TCP/IP
protocol suite used in production. The TCP/IP approach to
network communications is comprised of a set of protocols that
operate together to accomplish various tasks that allow network
devices to communicate with each other.
TCP/IP
OSI Layers
Layers
(7) Application
(6)
Application
Presentation
(5) Session
(4) Transport Transport
(3) Network Internet
(2) Data Link Data Link
:
(1) Physical Physical