0% found this document useful (0 votes)
21 views48 pages

Protocols and Switching

Data and Digital Communication

Uploaded by

Juan Dela Cruz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
21 views48 pages

Protocols and Switching

Data and Digital Communication

Uploaded by

Juan Dela Cruz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 48

PROTOCOLS AND SWITCHING

INTERNET PROTOCOLS (IP)

The Internet Protocol (IP) is a fundamental


protocol in the suite of internet protocols that
enables data transmission across networks,
forming the backbone of the internet. IP is part of
the Internet Protocol Suite, commonly known as
TCP/IP (Transmission Control Protocol/Internet
Protocol), and operates at the network layer (Layer
3) of the OSI (Open Systems Interconnection)
model.
KEY FUNCTIONS OF IP

1. Addressing: IP assigns unique numerical identifiers (IP


addresses) to each device on a network, allowing devices to
locate and communicate with one another.
2. Fragmentation and Reassembly: IP can break down large
packets of data into smaller chunks to ensure they can travel
across networks with varying maximum transmission units
(MTU). The destination device reassembles the packets to
reconstruct the original data.
3. Routing: IP routes packets from a source to a destination
across potentially multiple networks using routers. It
chooses the most efficient path to reach the target
destination.
VERSIONS OF INTERNET PROTOCOL

1. IPv4: Internet Protocol version 4 (IPv4) is the original


version, utilizing a 32-bit address format, allowing for about
4.3 billion unique addresses. IPv4 uses dot-decimal notation
(e.g., 192.168.1.1) and is widely used but limited in address
space, leading to the adoption of IPv6.
2. IPv6: Internet Protocol version 6 (IPv6) was developed to
address the limitations of IPv4, notably the shortage of
available addresses. IPv6 uses a 128-bit address space,
supporting a vastly larger number of addresses (around
3.4×10383.4×10 38 ), expressed in hexadecimal notation
(e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). IPv6 also
improves upon IPv4 in terms of efficiency and security.
HOW IP WORKS

When data is sent over the internet, it is broken


down into smaller packets. Each packet includes
headers containing source and destination IP
addresses, among other information. Routers use
this information to forward packets from one
network to another, guiding them through the
most efficient route until they reach their
destination.
IP PROTOCOLS IN THE SUITE

IP is a connectionless protocol, meaning it doesn’t


establish a connection before sending data
packets, nor does it guarantee delivery. To make IP
more reliable, other protocols work in conjunction
with it:
IP PROTOCOLS IN THE SUITE

TCP (Transmission Control Protocol): Establishes


connections, ensures reliable data delivery, and
reorders packets in the correct sequence.
UDP (User Datagram Protocol): Provides a faster,
connectionless communication method,
commonly used for streaming services where
speed is prioritized over reliability.
LIMITATIONS OF IP

IP lacks built-in mechanisms for reliability,


ordering, and data integrity, as it is a best-effort
delivery protocol. Therefore, higher-level
protocols, like TCP, manage these aspects.
SIGNIFICANCE OF IP

IP has been instrumental in making the internet a


global, interconnected network. It is adaptable to
diverse environments, allowing devices of
different types to communicate across complex
networks efficiently and flexibly.
IPV4 ADDRESS STRUCTURE

IPv4 addresses are 32-bit binary numbers,


represented in decimal form as four octets
separated by dots (e.g., 192.168.1.1). Each octet
can range from 0 to 255, resulting in a range of IP
addresses from 0.0.0.0 to 255.255.255.255.
IPV4 CLASSES

IPv4 classes differ in terms of the structure and


intended use of IP addresses, as outlined below:
1. Class A
2. Class B
3. Class C
4. Class D
5. Class E
CLASS A

Range: 0.0.0.0 to 127.255.255.255


Default Subnet Mask: 255.0.0.0
Purpose: Designed for very large networks.
Structure: In Class A, the first octet is used for the
network identifier, and the remaining three octets
are used for host addresses.
CLASS A

Number of Networks: 128 (including special


addresses).
Number of Hosts per Network: Over 16 million,
given by 224−22 24 −2.
Example: A typical Class A address might be
10.0.0.1.
CLASS B

Range: 128.0.0.0 to 191.255.255.255


Default Subnet Mask: 255.255.0.0
Purpose: Intended for medium-sized networks.
Structure: In Class B, the first two octets are
reserved for the network identifier, and the last
two octets are for hosts.
CLASS B

Number of Networks: 16,384.


Number of Hosts per Network: 65,534.
Example: 172.16.0.1.
CLASS C

Range: 192.0.0.0 to 223.255.255.255


Default Subnet Mask: 255.255.255.0
Purpose: Typically used for small networks.
Structure: The first three octets are for the
network identifier, and the last octet is for hosts.
CLASS C

Number of Networks: 2,097,152.


Number of Hosts per Network: 254.
Example: 192.168.1.1.
CLASS D (MULTICAST)

Range: 224.0.0.0 to 239.255.255.255


Purpose: Reserved for multicast addressing, used
to send data to multiple devices simultaneously.
Structure: There are no network or host bits;
instead, the entire address is used for the
multicast group.
Example: 224.0.0.1.
CLASS E (EXPERIMENTAL)

Range: 240.0.0.0 to 255.255.255.254


Purpose: Reserved for experimental and future
use.
Example: Addresses like 240.0.0.1 fall within this
class but are generally not used in standard
networking.
SPECIAL ADDRESSES WITHIN CLASSES

Network Address: The first address in any subnet,


used to identify the network itself.
Broadcast Address: The last address in any
subnet, used to communicate with all devices in
that network.
Loopback Address: 127.0.0.1, typically used for
testing network applications on the local
machine.
WHY CLASSES MATTER

The class-based system helped simplify network


management by assigning larger or smaller blocks
of IP addresses based on network size. However, as
the internet grew, the rigid class-based system
proved inefficient, leading to the development of
Classless Inter-Domain Routing (CIDR), which
allows more flexible IP address allocation by
breaking the traditional class boundaries.
TRANSMISSION CONTROL PROTOCO (TCP)

The Transmission Control Protocol (TCP) is a core


protocol of the Internet Protocol (IP) suite, often
combined with IP as TCP/IP. TCP operates at the
transport layer (Layer 4) of the OSI model, providing
reliable, ordered, and error-checked delivery of data
between applications on networked devices. TCP is
widely used for applications where accurate data
transmission is critical, such as web browsing, email,
and file transfer.
KEY FEATURES OF TCP

1. Connection-Oriented: TCP establishes a connection


between the sender and receiver before data transfer
occurs. This is known as the three-way handshake.
2. Reliable Delivery: TCP ensures that data is delivered
accurately. It detects lost or corrupted data and
retransmits it if necessary.
3. Data Sequencing and Reassembly: TCP breaks large
messages into smaller segments and assigns sequence
numbers, enabling the receiver to reassemble the data
in the correct order.
KEY FEATURES OF TCP

4. Error Checking: TCP includes error-checking


mechanisms that use checksums to detect any data
corruption during transmission.
5. Flow Control: TCP prevents the sender from
overwhelming the receiver by using flow control
mechanisms to match the data transmission rate with
the receiver’s processing capacity.
6. Congestion Control: TCP adjusts the data transmission
rate to manage network congestion, ensuring fair and
efficient use of network resources.
HOW TCP WORKS

TCP's operation can be divided into three main


phases: connection establishment, data transfer,
and connection termination.
HOW TCP WORKS

TCP's operation can be divided into three main


phases: connection establishment, data transfer,
and connection termination.
1. Connection Establishment (Three-Way
Handshake)
2. Data Transfer
3. Connection Termination
CONNECTION ESTABLISHMENT (THREE-
WAY HANDSHAKE)
The three-way handshake is used to establish a
connection between the sender and receiver:
SYN: The sender sends a synchronization (SYN) packet
to the receiver, indicating it wants to start a connection.
SYN-ACK: The receiver responds with a SYN-ACK
packet, acknowledging the request and signaling
readiness.
ACK: The sender replies with an acknowledgment
(ACK) packet, and the connection is established,
allowing data transfer.
DATA TRANSFER

Flow Control: TCP uses the Sliding Window


Protocol to control data flow, balancing the
sender’s rate with the receiver’s capacity.
Congestion Control: If network congestion is
detected, TCP slows down the data rate, gradually
increasing it once the network becomes less
congested.
DATA TRANSFER

Once the connection is established, TCP handles data


transmission in a reliable manner:
 Data Segmentation: TCP divides the message into
smaller segments and numbers them sequentially.
 Acknowledgment: After receiving a segment, the
receiver sends an acknowledgment (ACK) back to
confirm receipt.
 Retransmission: If an acknowledgment is not received
within a certain timeframe, the sender assumes the
segment was lost and retransmits it.
CONNECTION TERMINATION

TCP uses a four-step process to close a connection


gracefully:
FIN: The sender sends a FIN packet to signal that it has
finished sending data.
ACK: The receiver acknowledges the
FIN packet.FIN: The receiver then sends its own FIN packet,
signaling that it has also completed data transmission.
ACK: The sender sends a final acknowledgment, after
which the connection is terminated.
TCP HEADER

The TCP header contains essential information for


managing communication, including:
Source and Destination Ports: Identifying specific
applications or services on the devices.
Sequence and Acknowledgment Numbers: Used
to ensure ordered and reliable data delivery.
TCP HEADER

Window Size: Controls the flow of data, defining


the amount of data that can be sent before
requiring an acknowledgment.
Checksum: Used for error-checking to ensure data
integrity.
Control Flags: Indicate the purpose of the
segment, such as SYN, ACK, and FIN.
ADVANTAGES OF TCP

Reliability: TCP guarantees that data is delivered


accurately and in the correct order.
Flow Control and Congestion Control: TCP
dynamically adjusts the transmission rate,
preventing overload.
Error Detection and Correction: Built-in
checksums and retransmissions handle data
corruption and loss.
DISADVANTAGES OF TCP

Overhead: TCP’s reliability features add extra


overhead, making it slower than connectionless
protocols like UDP.
Resource Intensive: TCP requires more memory
and processing power due to its complex
mechanisms.
APPLICATIONS OF TCP

 TCP is used for applications where data integrity is crucial:


 Web Browsing (HTTP/HTTPS): Ensures web pages load
accurately.
 Email (SMTP, POP3, IMAP): Guarantees complete and
correct delivery of emails.
 File Transfer (FTP): Prevents file corruption during
downloads/uploads.
 Remote Access (SSH): Secures remote login sessions with
reliable data transfer.
INTERNET CONTROL MESSAGE
PROTOCOL (ICMP)
The Internet Control Message Protocol (ICMP) is a
network layer protocol used for error handling,
diagnostics, and informational messages in IP
networks. Part of the IP suite, ICMP is primarily
used by network devices, like routers, to send
messages about network issues or to test
connectivity between hosts. ICMP plays a key role
in managing and troubleshooting network
communication but does not carry user data itself.
KEY FEATURES OF ICMP

Error Reporting: ICMP reports errors when issues arise


during data transmission, such as unreachable hosts or
routers. It does not, however, correct these errors;
instead, it notifies the sender.
Network Diagnostics: ICMP is widely used for
diagnostic purposes, allowing users and administrators
to test network connectivity and performance.
Operational Messaging: Provides essential control
messages to guide packet handling, supporting routers
and other devices in efficient network management.
HOW ICMP WORKS

ICMP sends messages in response to specific


network events or commands, using IP packets for
communication. Each ICMP message is structured
with a header that includes fields like Type, Code,
and Checksum to identify the type of message and
check for errors. Commonly used ICMP message
types include:
HOW ICMP WORKS

 Echo Request and Echo Reply: Used by the ping


command to test if a host is reachable and measure
the round-trip time.
 Destination Unreachable: Sent when a router or host
cannot deliver a packet to the intended destination.
 Time Exceeded: Issued when a packet's TTL (Time to
Live) expires, preventing endless packet loops.
 Redirect Message: Informs a host of a better route to
reach a particular destination.
COMMON ICMP MESSAGE TYPES

Echo Request (Type 8) and Echo Reply (Type 0):


Purpose: Used in the ping command to test
connectivity between devices. When an Echo
Request is sent, the target responds with an Echo
Reply if reachable.
Application: Verifying host availability and
measuring latency.
COMMON ICMP MESSAGE TYPES

Destination Unreachable (Type 3):


Purpose: Sent when a packet cannot reach its destination for various
reasons, including:
 Network Unreachable (Code 0): No route to the destination network.
 Host Unreachable (Code 1): The target host is unavailable.
 Protocol Unreachable (Code 2): The protocol is not supported at the
destination.
 Port Unreachable (Code 3): The target port is closed.
Application: Notifying the sender about issues in delivering packets,
allowing for alternative routing.
COMMON ICMP MESSAGE TYPES

Time Exceeded (Type 11):


Purpose: Informs the sender that a packet's TTL
expired. TTL limits the number of hops a packet
can take to prevent infinite loops.
Application: Used in traceroute to track the path of
packets across networks by observing TTL values.
COMMON ICMP MESSAGE TYPES

Redirect (Type 5):


Purpose: Sent by routers to inform a host of a
more optimal route to reach a destination.
Application: Optimizes routing in a network by
notifying hosts of better paths.
DIAGNOSTIC TOOLS USING ICMP

ICMP powers several essential network diagnostic


tools, including:
Ping: This utility sends ICMP Echo Requests to a
target host and awaits Echo Replies to verify if the
host is reachable. It also measures latency,
allowing network administrators to assess
connectivity and response times.
DIAGNOSTIC TOOLS USING ICMP

Traceroute: This tool uses ICMP Time Exceeded


messages to trace the route packets take from
source to destination. By incrementing the TTL
value of packets, it maps out each hop in the path,
providing insight into routing and potential
bottlenecks.
SECURITY CONSIDERATIONS WITH ICMP

ICMP, though valuable for diagnostics, can also pose


security risks:
ICMP Flood Attacks: Attackers can overwhelm a
network with excessive ICMP requests, disrupting
normal traffic (a type of Denial of Service attack).
Ping of Death: An attacker sends an oversized ICMP
packet, potentially crashing the target device if it
cannot handle large packets.
ICMP Redirection: ICMP Redirect messages can be
exploited to reroute traffic through malicious routers.
SECURITY CONSIDERATIONS WITH ICMP

To mitigate these risks, administrators often


restrict certain ICMP messages on sensitive
networks or limit ICMP requests to specific trusted
sources.
ROLE AND IMPORTANCE OF ICMP

ICMP is critical in IP networks for maintaining and


troubleshooting network health. It allows
administrators to check connectivity, trace packet
paths, and diagnose problems when data
transmission fails. Although it does not ensure
data delivery (as TCP does), ICMP’s role in error
reporting and diagnostics is essential for
maintaining efficient, robust, and reliable network
communication.

You might also like