Computer Network Important Module1
Computer Network Important Module1
1) Encapsulation:
Encapsulation in networking refers to the process of wrapping data with the necessary
protocol information before it's transmitted across the network. It involves adding headers
(and sometimes trailers) to the data at each layer of the OSI or TCP/IP model.
• At the Network Layer, the segment becomes a packet, and the network header
includes information like source and destination IP addresses.
• At the Data Link Layer, it’s encapsulated into a frame, with a header containing MAC
addresses and other data necessary for local delivery.
• At the Physical Layer, the frame is converted into a series of bits for transmission
over the medium (copper, fiber, etc.).
This process allows each layer to handle its own responsibility independently, simplifying the
communication process.
• Routing: Determining the best path for data to travel across networks. Routers
operate at this layer to make forwarding decisions.
• Logical Addressing: Assigning and using IP addresses (or similar logical addressing
schemes) to uniquely identify devices across networks. The Network Layer is
responsible for ensuring the data can reach the correct destination based on its IP
address.
• Packet Forwarding: Moving packets from the source to the destination across
different networks. The network layer ensures that each packet can be routed and
passed through various intermediary devices.
1
• Error Handling: The Network Layer can also detect some types of errors in the packet
header (though it's not responsible for correcting all errors—this is handled more by
the Data Link Layer).
Data communication is the process of transmitting data between devices over a medium. It
involves sending and receiving data from one device to another, typically through electrical
signals, light pulses, or radio waves.
The basic block diagram of data communication consists of several components, which are
responsible for different aspects of the communication process:
| (Source) | | | | Medium |
| |
v v
+----------------+ +-----------------+
| (Destination)| | (Device) |
+----------------+ +-----------------+
1. Sender (Source):
o The sender is the device that originates the data. This could be a computer,
smartphone, or sensor.
2. Transmitter:
o The transmitter is responsible for encoding the data from the sender into a
suitable signal that can be sent over the transmission medium.
2
3. Transmission Medium:
o The transmission medium is the physical path through which the data travels.
o It can be wired (like copper cables, fiber-optic cables) or wireless (like radio
waves, microwaves, or satellite signals).
4. Receiver:
o The receiver is the device that receives the signal from the transmission
medium.
o It decodes the signal back into the original data format that the receiver can
understand.
1. Data Generation (Sender): The sender creates data in the form of messages, files, or
signals.
2. Encoding (Transmitter): The transmitter converts the data into a suitable format for
transmission (signal modulation or formatting).
3. Transmission: The data travels through the transmission medium. During this phase,
the data may be subject to interference, noise, or signal degradation.
4. Reception (Receiver): The receiver picks up the transmitted signal and decodes it to
retrieve the original data.
3)what are the different network cireteria and peer to peer process
When designing and evaluating computer networks, certain criteria must be considered to
ensure the network is efficient, reliable, and meets the needs of the users. These criteria
help in assessing the performance and quality of the network.
1. Performance:
3
o Bandwidth: The data transfer rate of the network, usually measured in bits
per second (bps). Higher bandwidth means more data can be transferred in a
given period.
o Latency: The time it takes for data to travel from the source to the
destination. Lower latency is desirable for faster communication.
o Throughput: The actual rate at which data is successfully transferred over the
network, often influenced by network congestion, packet loss, and errors.
2. Reliability:
3. Scalability:
o The ability of the network to grow and handle increasing amounts of data,
devices, or users without significant degradation in performance. A scalable
network can accommodate more users and devices over time.
4. Security:
o The measures and protocols put in place to protect data from unauthorized
access, loss, or tampering. This includes encryption, firewalls, authentication,
and access control policies.
5. Cost:
o The financial cost of setting up, maintaining, and expanding the network. This
includes hardware, software, bandwidth costs, and personnel resources.
6. Manageability:
7. Topology:
4
Peer-to-Peer Process:
The Peer-to-Peer (P2P) process refers to a decentralized model where each device or node in
the network (called a peer) has equal responsibilities and can act as both a client and a
server. This is in contrast to the client-server model, where there is a central server providing
services to client devices.
1. Decentralization:
o There is no central server; instead, all peers are considered equals, and they
can share resources (like files, processing power, etc.) with each other.
2. Resource Sharing:
3. Direct Communication:
o Devices in a P2P network can communicate directly with one another, usually
via the internet or local area network (LAN). This reduces the need for an
intermediary (like a server).
4. Scalability:
o P2P networks can scale easily, as adding more peers increases the network’s
resources rather than creating a burden. Each new peer contributes to the
network's capabilities.
o If one peer fails, others can still function because there is no single point of
failure. However, data and resources are often duplicated across multiple
peers to ensure redundancy.
5
Peer-to-Peer Communication Process:
1. Connection Establishment:
o Peers first identify and establish connections with other peers. This may
involve a process like discovery or using a tracker (in file-sharing apps) to find
peers.
2. Data Exchange:
o Once connected, peers can exchange data directly with each other. In file-
sharing, for instance, peers might exchange file parts and check if any parts
are missing or corrupted.
3. Resource Sharing:
4. Synchronization:
5. Security:
1) Physical layer
o The main functionality of the physical layer is to transmit the individual bits from one
node to another node.
6
o Line Configuration: It defines the way how two or more devices can be connected
physically.
o Signals: It determines the type of the signal used for transmitting the information.
2) Data-Link Layer
o It is mainly responsible for the unique identification of each device that resides on a
local network.
o A Media access control layer is a link between the Logical Link Control
layer and the network's physical layer.
o Framing: The data link layer translates the physical's raw bit stream into packets
known as Frames. The Data link layer adds the header and trailer to the frame. The
header which is added to the frame contains the hardware destination and source
address.
o Physical Addressing: The Data link layer adds a header to the frame that contains a
destination address. The frame is transmitted to the destination address mentioned
in the header.
7
o Flow Control: Flow control is the main functionality of the Data-link layer. It is the
technique through which the constant data rate is maintained on both the sides so
that no data get corrupted. It ensures that the transmitting station such as a server
with higher processing speed does not exceed the receiving station, with lower
processing speed.
o Error Control: Error control is achieved by adding a calculated value CRC (Cyclic
Redundancy Check) that is placed to the Data link layer's trailer which is added to the
message frame before it is sent to the physical layer. If any error seems to occurr,
then the receiver sends the acknowledgment for the retransmission of the corrupted
frames.
o Access Control: When two or more devices are connected to the same
communication channel, then the data link layer protocols are used to determine
which device has control over the link at a given time.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of
devices on the network.
o It determines the best path to move data from source to the
destination based on the network conditions, the priority of service,
and other factors.
o The Data link layer is responsible for routing and forwarding the
packets.
o Routers are the layer 3 devices, they are specified in this layer and
used to provide the routing services within an internetwork.
o The protocols used to route the network traffic are known as
Network layer protocols. Examples of protocols are IP and Ipv6.
Functions of Network Layer:
o Internetworking: An internetworking is the main responsibility of
the network layer. It provides a logical connection between different
devices.
o Addressing: A Network layer adds the source and destination
address to the header of the frame. Addressing is used to identify the
device on the internet.
o Routing: Routing is the major component of the network layer, and
it determines the best optimal path out of the multiple paths from
source to the destination.
o Packetizing: A Network Layer receives the packets from the upper
layer and converts them into packets. This process is known as
Packetizing. It is achieved by internet protocol (IP).
8
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are transmitted in the order in
which they are sent and there is no duplication of data.
o The main responsibility of the transport layer is to transfer the data completely.
o It receives the data from the upper layer and converts them into smaller units known
as segments.
o When data is sent over the TCP connection, then the TCP protocol divides the
data into smaller units known as segments. Each segment travels over the
internet using multiple routes, and they arrive in different orders at the
destination. The transmission control protocol reorders the packets in the
correct order at the receiving end.
o It is an unreliable transport protocol as in this case receiver does not send any
acknowledgment when the packet is received, the sender does not wait for
any acknowledgment. Therefore, this makes a protocol unreliable.
o Segmentation and reassembly: When the transport layer receives the message from
the upper layer, it divides the message into multiple segments, and each segment is
assigned with a sequence number that uniquely identifies each segment. When the
9
message has arrived at the destination, then the transport layer reassembles the
message based on their sequence numbers.
o Flow control: The transport layer also responsible for flow control but it is performed
end-to-end rather than across a single link.
o Error control: The transport layer is also responsible for Error control. Error control is
performed end-to-end rather than across the single link. The sender transport layer
ensures that message reach at the destination without any error. 5) Session Layer
5) Session Layer
o It is a layer 3 in the OSI model.
o The Session layer is used to establish, maintain and synchronizes the
interaction between communicating devices.
Functions of Session layer:
o Dialog control: Session layer acts as a dialog controller that creates a
dialog between two processes or we can say that it allows the
communication between two processes which can be either half-
duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when
transmitting the data in a sequence. If some error occurs in the
middle of the transmission of data, then the transmission will take
place again from the checkpoint. This process is known as
Synchronization and recovery.
6) Presentation Layer
10
handles the interoperability between the different encoding
methods. It converts the data from sender-dependent format into a
common format and changes the common format into receiver-
dependent format at the receiving end.
o Encryption: Encryption is needed to maintain privacy. Encryption is a
process of converting the sender-transmitted information into
another form and sends the resulting message over the network.
o Compression: Data compression is a process of compressing the
data, i.e., it reduces the number of bits to be transmitted. Data
compression is very important in multimedia such as text, audio,
video.
7) Application Layer
Mesh Topology
Mesh Topology
Star Topology
12
In Star Topology, all the devices are connected to a single hub through
a cable. This hub is the central node and all other nodes are connected
to the central node. The hub can be passive in nature i.e., not an
intelligent hub such as broadcasting devices, at the same time the hub
can be intelligent known as an active hub. Active hubs have repeaters
in them. Coaxial cables or RJ-45 cables are used to connect the
computers. In Star Topology, many popular Ethernet LAN protocols are
used as CD(Collision Detection), CSMA (Carrier Sense Multiple Access),
etc.
Star Topology
• Each device requires only 1 port i.e. to connect to the hub, therefore
the total number of ports required is N.
• It is Robust. If one link fails only that link will affect and not other
than that.
13
• If the concentrator (hub) on which the whole topology relies fails, the
whole system will crash down.
Bus Topology
Bus Topology
14
• Bus topology is familiar technology as installation and
troubleshooting techniques are well known.
• If the common cable fails, then the whole system will crash down.
Ring Topology
Ring Topology
15
The most common access method of ring topology is token passing.
• To transmit the data, the station has to hold the token. After the
transmission is done, the token is to be released for other stations to
use.
• The failure of a single node in the network can cause the entire
network to fail.
16
• Less secure.
Tree Topology
Tree topology is the variation of the Star topology. This topology has a
hierarchical flow of data. In Tree Topology, protocols like DHCP and SAC
(Standard Automatic Configuration) are used.
Tree Topology
• It allows the network to get isolated and also prioritize from different
computers.
17
• If new devices are added, it becomes difficult to reconfigure.
Hybrid Topology
Hybrid Topology
The above figure shows the structure of the Hybrid topology. As seen it
contains a combination of all different types of networks.
18
• Hubs used in this topology are very expensive.
1. Separation of Concerns:
o Each layer handles a distinct set of functionalities. This
separation makes it easier to design, implement, and maintain
the system because you can focus on one part at a time
without worrying about the details of other layers.
2. Modularity:
o Each layer is designed to be independent, so changes in one
layer do not affect other layers (as long as the interface
between the layers remains the same). This modular approach
makes systems more flexible and easier to scale.
3. Interlayer Communication:
o Layers interact with each other through well-defined
interfaces. For example, one layer might provide services to
the layer above it, while relying on services from the layer
below it.
4. Abstraction:
o Each layer abstracts its own internal details and only exposes
the necessary functionality to the adjacent layers. This
abstraction makes the system more understandable and
easier to maintain, as higher layers do not need to know the
details of lower layers.
5. Encapsulation:
o Data is encapsulated within the layers as it moves down or up
the stack. For example, at each layer, data is packaged with
headers or metadata relevant to that layer’s operations.
19
Layered Architecture in Networking (OSI Model Example):
1. Physical Layer: Deals with the physical medium (cables, radio waves)
used for transmitting raw data.
2. Data Link Layer: Ensures data transfer across a single network link,
detecting errors and managing access to the physical medium.
3. Network Layer: Handles routing and forwarding of data between
different networks, using logical addressing (IP addresses).
4. Transport Layer: Provides reliable end-to-end communication, flow
control, error detection, and data segmentation/reassembly.
5. Session Layer: Manages sessions or connections between
applications, ensuring that data exchange is properly synchronized.
6. Presentation Layer: Translates data into a format suitable for the
application, handling tasks like encryption, compression, and
translation.
7. Application Layer: Provides application services such as email, file
transfer, and web browsing to end users.
20
o New layers or functionalities can be added as needed without
disrupting existing ones, which is useful when scaling systems
or introducing new technologies.
4. Easier Troubleshooting:
o If something goes wrong, it's easier to pinpoint the problem by
isolating the layer responsible for the issue. Network
troubleshooting, for example, can be done by analyzing
specific layers (e.g., physical layer issues or application layer
bugs).
5. Encapsulation and Abstraction:
o The abstraction provided by the layers hides the complexities
of each layer’s operation from the others, which simplifies both
use and maintenance. For instance, an application doesn't
need to worry about the network's low-level transmission
methods.
6. Interoperability:
o With standard interfaces between layers, different systems or
devices from various manufacturers can communicate
effectively, as long as they adhere to the same protocols and
standards in the layers involved.
1. Performance Overhead:
o Each layer adds overhead due to the additional processing
required for encapsulation, addressing, or error handling. This
may lead to performance issues, especially in systems where
low latency or high throughput is critical.
2. Excessive Abstraction:
o While abstraction simplifies understanding and development,
it can also hide important details that might be critical for
optimization or deep troubleshooting. It could make it difficult
to tune performance or understand low-level behavior.
3. Rigid Structure:
o Some systems may require a more flexible or adaptive
approach. Layered architectures can be too rigid for certain
dynamic systems or use cases that require custom interactions
between layers.
4. Incompatibilities Between Layers:
21
o If layers are designed with different standards or
implementations, incompatibilities may arise. This could cause
issues in communication between systems or devices that
don't fully adhere to the same model.
The Physical Layer is the first layer of the OSI model and plays a critical
role in the communication process. It is responsible for the actual
transmission of raw data bits (0s and 1s) over a physical medium, such
as cables, fiber optics, or wireless signals. This layer defines the physical
means of sending data between devices and ensures that data is
transmitted and received correctly at the hardware level.
• The physical layer takes the data from the upper layers (like the Data
Link Layer) and converts it into a physical signal (electrical, light, or
radio waves) for transmission over the medium.
• It encodes the data into a form suitable for transmission, such as
converting binary 1s and 0s into electrical pulses or light signals.
2. Bit Transmission:
• The physical layer defines the type of physical media used for data
transmission (e.g., twisted pair cables, coaxial cables, fiber-optic
cables, or air for wireless transmission).
• It is also responsible for determining the type of electrical or optical
signals used on the medium (e.g., electrical pulses, light pulses, radio
waves).
• The Physical Layer defines the bit rate, which is the number of bits
transmitted per second (bps). It determines how fast data is sent
over the medium.
• The bit rate may depend on the medium and transmission method,
and it helps regulate how quickly the system can transmit data.
• While the physical layer is not responsible for error correction, it can
detect simple errors, like signal loss or corruption, through basic
checks (e.g., using special error-detection codes like parity).
• In some cases, the physical layer may be able to request
retransmission of corrupted data through lower-level mechanisms
(though actual error correction is handled at higher layers like the
Data Link Layer).
8. Synchronization:
• The Physical Layer ensures that the sender and receiver are
synchronized so they know when to send and receive bits. It uses
clock signals or timing mechanisms to keep the transmission and
reception aligned, ensuring data is interpreted at the correct
intervals.
23
9. Connector and Voltage Specifications:
• The Physical Layer defines the connector types (e.g., RJ45 for
Ethernet) and the voltage levels used for transmitting data signals.
These electrical or optical specifications ensure that devices can
physically connect and communicate.
• In some cases, the Physical Layer may be responsible for basic data
compression or encryption before transmission, though these tasks
are more typically handled by higher layers (e.g., Presentation Layer
or Transport Layer).
24
• Description: The Presentation Layer is responsible for translating,
encrypting, and compressing data. The data from the Application
Layer is often formatted here (e.g., converting from ASCII to EBCDIC
or compressing a file). In some cases, encryption such as SSL/TLS is
applied for secure communication.
• Note: The data remains in the form of "data" as it passes through this
layer; it does not have a new packet format, but its content may be
transformed for compatibility or security.
25
5. Network Layer (Layer 3)
26
waves). It takes the frame from the Data Link Layer and converts it
into bits, which are transmitted as signals over the physical medium.
o Bit Transmission: The data is transmitted as binary digits (0s
and 1s), which represent electrical voltages, light pulses, or
radio waves. The Physical Layer does not handle data
formatting but focuses on sending and receiving the bits
accurately over the medium.
27
network communication, particularly over the internet. It is simpler and
more practical than the OSI model and serves as the foundation for
how data is transmitted across networks.
The TCP/IP model is structured into four layers. These layers correspond
to the OSI model but with some consolidation. Here’s a breakdown of
the TCP/IP model’s layers:
1. Application Layer
2. Transport Layer
28
establishing a connection before data is sent. It includes
features like sequencing, flow control, and error checking.
o UDP (User Datagram Protocol): A connectionless protocol
that sends data without establishing a connection or ensuring
reliability. It is faster but less reliable than TCP.
• Example: When you send an email, the data may be transmitted
using TCP to ensure reliability.
3. Internet Layer
30
3. Sending Data: The client sends data (datagram) to the server using
the sendto() function, providing the destination address and port.
4. Receiving Data: The server listens for incoming messages using the
recvfrom() function, which retrieves the message and the source
address (IP and port).
5. Closing the Socket: Once communication is complete, both the
client and server close the socket to release resources
2. Mapping Services:
31
• IP Address to Host Name Mapping: Through reverse DNS lookups,
DNS can map an IP address to its associated domain name. This
service is often used for logging and troubleshooting purposes.
3. Mail Routing:
4. Load Balancing:
5. Name Delegation:
32
• This enables hierarchical management of domain names across the
internet.
6. Caching:
7. Security Features:
33
• For example, SRV records allow clients to discover which server
provides a particular service (e.g., which server is responsible for
handling VoIP calls for a domain).
• Client-Server Model:
34
HTTP operates on a client-server model, where the client initiates a
request and the server fulfills it by sending a response.
• Request Structure:
• Method: Specifies the action to be performed (e.g., GET to
retrieve data, POST to send data).
• URI: Uniform Resource Identifier, the address of the requested
resource.
• Headers: Additional information like content type, cookies,
and authentication details.
• Body: Optional data to be sent with the request (like form data
in a POST request).
• Response Structure:
• Status Code: A numerical code indicating the outcome of the
request (e.g., 200 for success, 404 for not found).
• Headers: Information about the response like content type
and caching details.
• Body: The actual content requested, like HTML, text, or an
image.
How it works:
2. 2. Server processing:
35
The client receives the response, parses the headers, and displays
the content in the browser window.
Example:
• Request:
• Method: GET
• URI: https://www.example.com/index.html
• Headers: "Accept: text/html"
• Response:
• Status Code: 200 (OK)
• Headers: "Content-Type: text/html"
• Body: The HTML content of the "index.html" page
• HTTP is stateless:
• Error Codes:
36
o HTTP: Port 80
o HTTPS (secure HTTP): Port 443
37
o POP3S (POP3 Secure): Port 995
8. Telnet
38
• Purpose: Telnet is used for remote login and communication with
remote devices over a network. It allows users to access command-
line interfaces of remote computers or network devices.
• Function: Telnet provides text-based communication and requires
an interactive terminal.
• Common Ports:
o Telnet: Port 23
39
• Function: HTTPS ensures that communication is encrypted and
secure, protecting users from man-in-the-middle attacks and
eavesdropping.
• Common Ports:
o HTTPS: Port 443
• Purpose: RTP is used for delivering real-time data like audio and
video over a network. It is commonly used in voice and video
communications (e.g., VoIP, video conferencing).
• Function: RTP provides end-to-end delivery services, including
payload type identification, sequence numbering, and timestamping
to ensure proper timing and order for media data.
• Common Ports:
o RTP: Port 5004
o RTCP (RTP Control Protocol): Port 5005
40
and relies on other application protocols (like HTTP or SMTP) for
message transmission.
• Function: SOAP defines a message format for requests and
responses, ensuring interoperability between web services.
• Common Ports: Typically used over HTTP (Port 80) or HTTPS (Port
443).
14) How does the information passed from one layer to another layer in
OSI model
When data is passed down the OSI model from the Application
Layer to the Physical Layer, it is encapsulated by each layer. This
means that each layer adds its own header (and sometimes footer)
to the data to ensure that it can be properly processed by the
corresponding layer on the receiving side.
41
Encapsulation Process:
1. Application Layer:
o The application data is generated (e.g., a user request in a
browser, an email message, etc.).
o This is the data that the user or application sends.
2. Presentation Layer:
o If necessary, the data is converted into a format suitable for
transmission.
o This could involve data compression, encryption, or translation
between different data formats.
o The data is then passed to the Session Layer.
3. Session Layer:
o The session layer establishes, manages, and terminates
communication sessions.
o It adds control information to maintain the session, such as
session identifiers, to manage multiple communication
sessions.
o The data is passed to the Transport Layer.
4. Transport Layer:
o The transport layer is responsible for end-to-end
communication and reliability.
o It adds a transport header that includes port numbers,
sequence numbers, and error-checking mechanisms like
checksums to ensure data integrity.
o The segment is then passed to the Network Layer.
5. Network Layer:
o The network layer adds its own network header, which
includes information such as the source and destination IP
addresses for routing purposes.
o The data unit is now called a packet.
o The packet is passed down to the Data Link Layer.
6. Data Link Layer:
o The data link layer is responsible for node-to-node
communication and error detection within a network
segment.
o It adds a frame header and trailer. The header contains the
MAC addresses of the source and destination devices, and the
trailer contains error-detection information (such as a CRC
checksum).
o The data unit is now called a frame.
42
o The frame is passed to the Physical Layer.
7. Physical Layer:
o The physical layer converts the frame into electrical or optical
signals, radio waves, or light pulses, depending on the
transmission medium (e.g., copper wires, fiber optics, wireless).
o The data is now transmitted as raw bits over the medium.
On the receiving side, the data moves up the OSI model in the
reverse order. Each layer decapsulates the information by stripping
off its corresponding header or footer before passing the data to the
next higher layer.
Decapsulation Process:
1. Physical Layer:
o The physical layer receives the raw bits (electrical signals, light
pulses, etc.) and converts them back into a frame of data.
o It passes the frame up to the Data Link Layer.
2. Data Link Layer:
o The data link layer checks the frame for errors and verifies the
integrity using the trailer (such as a checksum or CRC).
o It removes the frame's header and trailer, extracting the
packet.
o The packet is then passed to the Network Layer.
3. Network Layer:
o The network layer looks at the packet's header to extract
routing information (such as source and destination IP
addresses) and determines the correct destination.
o It removes the network layer's header, leaving the transport
segment.
o The segment is passed to the Transport Layer.
4. Transport Layer:
o The transport layer processes the header information,
including sequence numbers and error checks.
o It removes the transport layer's header and passes the
remaining data to the Session Layer.
5. Session Layer:
43
o The session layer manages the session state and removes any
session-specific information from the data.
o The remaining data is passed to the Presentation Layer.
6. Presentation Layer:
o If any data translation, decompression, or decryption was done
earlier, the presentation layer reverses those processes (e.g.,
decompression or decryption).
o The data is now in the original format and passed to the
Application Layer.
7. Application Layer:
o The application layer processes the data and presents it to the
end-user or application (e.g., displaying a webpage or showing
an email).
o The data is now available for use by the receiving application.
The idea is to create a virtual terminal that both the local and
remote systems can agree upon, allowing devices with different
terminal capabilities (e.g., different character encodings, screen sizes,
etc.) to communicate in a way that is universally understood. The
NVT standardizes the character set and control codes used in Telnet
communication.
44
control characters are sent in a standard way over the Telnet
connection.
3. Terminal Independence: The NVT protocol abstracts the differences
in terminal types, allowing a client to connect to a server regardless
of the specific type of terminal (whether it's a simple terminal,
graphical user interface, or other devices). The remote system "sees"
the client as if it were a standard, virtual terminal.
4. Telnet and NVT: Telnet uses the NVT as a way to ensure that data
transmitted across the network follows a standard protocol. The NVT
allows Telnet clients and servers to understand each other, even if
the actual physical terminals being used are different or use
different configurations.
Error checking TCP provides extensive error- UDP has only the basic
mechanism checking mechanisms. It is because it error-checking
45
User Datagram Protocol
Basis Transmission Control Protocol (TCP) (UDP)
No acknowledgment
Acknowledgment An acknowledgment segment is present.
segment.
There is no sequencing
Sequencing of data is a feature of
of data in UDP. If the
Transmission Control Protocol (TCP). this
Sequence order is required, it has
means that packets arrive in order at the
to be managed by the
receiver.
application layer.
There is no
retransmission of lost
Retransmission of lost packets is
Retransmission packets in the User
possible in TCP, but not in UDP.
Datagram Protocol
(UDP).
It’s a connectionless
Handshaking Uses handshakes such as SYN, ACK, SYN-
protocol i.e. No
Techniques ACK
handshake
46
User Datagram Protocol
Basis Transmission Control Protocol (TCP) (UDP)
UDP supports
Broadcasting TCP doesn’t support Broadcasting.
Broadcasting.
UDP is used
TCP is used by HTTP, by DNS , DHCP ,
Protocols
HTTPs , FTP , SMTP and Telnet . TFTP, SNMP , RIP ,
and VoIP .
UDP connection is a
Stream Type The TCP connection is a byte stream.
message stream.
1. Connection-Oriented Communication
47
1. SYN: The sender sends a synchronize (SYN) message to
the receiver to initiate the connection.
2. SYN-ACK: The receiver acknowledges the SYN request
and sends a SYN-ACK message back to the sender.
3. ACK: The sender sends an acknowledgment (ACK) to the
receiver, confirming the connection.
o Once the handshake is complete, data transmission begins.
4. Flow Control
48
which indicates the amount of data that can be sent before an
acknowledgment is required.
• Sliding Window: This dynamic mechanism allows for the efficient
use of the network and ensures that the sender doesn't overwhelm
the receiver with more data than it can handle at a time.
5. Congestion Control
6. Full-Duplex Communication
7. Connection Termination
49
2. The receiver acknowledges the FIN and sends an ACK.
3. The receiver sends its own FIN message to the sender to
indicate it has finished.
4. The sender acknowledges the receiver's FIN message with an
ACK, completing the termination.
9. Error Detection
50
• Connection Establishment and Maintenance: TCP provides
mechanisms to establish and maintain the connection, monitor the
status of the connection, and ensure that both the sender and
receiver are synchronized.
• TCP Segment Structure: The TCP header contains various fields for
managing the connection, such as source and destination port
numbers, sequence and acknowledgment numbers, flags (SYN,
ACK, FIN, etc.), window size, and checksum. These fields are
essential for maintaining reliable communication.
The Transport Layer (Layer 4) is a crucial part of the OSI model that
is responsible for ensuring end-to-end communication between
devices across a network. It plays a key role in providing reliable and
efficient data transfer, managing flow control, error correction, and
segmentation. The Transport Layer establishes, maintains, and
terminates connections between devices, and ensures that data is
delivered reliably and in the correct order.
1. End-to-End Communication
51
2. Segmentation and Reassembly
3. Flow Control
52
5. Reliable Data Delivery (TCP Only)
53
manner, ensuring that no data is lost and that the resources
are properly released.
9. Port Addressing
• The Transport Layer uses port numbers to address and identify the
source and destination applications or services on each device.
o For example, port 80 is used for HTTP traffic, and port 443 is
used for HTTPS traffic.
• This allows the Transport Layer to demultiplex data from different
applications running on the same device.
54
21)difference between connection less and connection oriented
service with diagram
55