0% found this document useful (0 votes)
10 views36 pages

CHN Unit 05 Part 03

The document provides an overview of TCP and UDP protocols, explaining their differences, uses, and the concept of ports in networking. It details the classification of ports (well-known, registered, and dynamic/private) and their significance in network communication. Additionally, it covers IP addresses, including their types (public, private, static, dynamic) and the differences between IPv4 and IPv6 addressing schemes.

Uploaded by

liyanagepragathi
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)
10 views36 pages

CHN Unit 05 Part 03

The document provides an overview of TCP and UDP protocols, explaining their differences, uses, and the concept of ports in networking. It details the classification of ports (well-known, registered, and dynamic/private) and their significance in network communication. Additionally, it covers IP addresses, including their types (public, private, static, dynamic) and the differences between IPv4 and IPv6 addressing schemes.

Uploaded by

liyanagepragathi
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/ 36

Achira Dasanayaka

COMPUITER
HARDWARE
NETWORKING
AND SERVER
CONFIGURATION
Java Institute

TCP AND UDP PORTS.

Start Slide
Java Institute

Introduction to TCP and UDP


TCP and UDP are two core protocols of the Internet Protocol Suite. They are used for
transmitting data over networks, but they operate differently:

TCP is a connection-oriented protocol that ensures reliable data transmission. It establishes


a connection between the sender and receiver before data is sent, and it guarantees that
packets are delivered in order and without errors.

UDP, on the other hand, is a connectionless protocol that does not guarantee delivery, order,
or error checking. It is faster and more efficient for applications that can tolerate some data
loss, such as video streaming or online gaming.
Java Institute

What is a Port?

A port is a virtual endpoint for communication in a network. It is a 16-bit


number (ranging from 0 to 65535) that helps identify which application
or service should receive incoming data. Ports allow multiple
applications to use the network simultaneously on the same device.

Well-known ports: 0–1023 (reserved for standard services like HTTP,


FTP, etc.)
Registered ports: 1024–49151 (used by applications or services)
Dynamic/private ports: 49152–65535 (used for temporary or private
connections)
Java Institute

What is a 16-bit Number?

A bit is the smallest unit of data in computing and can have a value of either 0 or 1.
A 16-bit number is a binary number composed of 16 bits. Each bit represents a
power of 2, and the total number of unique values a 16-bit number can represent is
calculated as:

This means a 16-bit number can represent 65,536 unique values, ranging from 0 to
65,535.
Java Institute

Well-known Ports (0–1023)

Purpose: Reserved for standard, widely-used services and protocols.


Managed by: Internet Assigned Numbers Authority (IANA).

Examples:

Port 80: HTTP (web browsing).


Port 443: HTTPS (secure web browsing).
Port 22: SSH (Secure Shell for remote access).
Port 21: FTP (File Transfer Protocol).
Port 25: SMTP (email sending).
Java Institute

Extra:-
The Internet Assigned Numbers Authority (IANA) is a global organization responsible
for coordinating and managing key aspects of the internet's infrastructure. One of its
primary roles is to oversee the allocation and assignment of port numbers, IP
addresses, and protocol parameters.

Why is IANA's Role Important?


1. Prevents Conflicts:
By managing port numbers, IANA ensures that no two services or applications use the same port,
which could cause conflicts.
2. Standardization:
IANA’s assignments create a consistent and predictable framework for internet communication.
3. Global Coordination:
IANA’s work ensures that internet resources are allocated fairly and efficiently across the globe.
Java Institute

Registered Ports (1024–49151)


Purpose: Used by applications or services that are not as widely standardized as
well-known ports.
Managed by: IANA (but less strictly controlled than well-known ports).

Examples:

Port 3306: MySQL database.


Port 3389: Remote Desktop Protocol (RDP).
Port 8080: Alternative HTTP port (often used for web servers, Ex :- Apache
Tomcat).
Port 27017: MongoDB database.

These ports are often used by user-level applications or services.


Java Institute

Dynamic/Private Ports (49152–65535)

Purpose: Used for temporary or private connections.


Managed by: The operating system dynamically assigns these ports to client
applications when they initiate a connection.

Examples:

When you open a web browser, your operating system might assign a
dynamic port (e.g., 52000) to the browser for its outgoing connection to a
web server.

These ports are also called ephemeral ports because they are short-lived and
reused after the connection ends.
Java Institute

Why Ports are Important


Multiplexing: Ports allow multiple applications to use the network
simultaneously on the same device.
Service Identification: Ports help identify which application or service should
handle incoming data.
Security: Firewalls and routers can use port numbers to allow or block specific
types of traffic.
Java Institute

PORT
PROTOCOL APPLICATION ACRONYM
NUMBER

80 TCP Hypertext Transfer Protocol HTTP (Web Browsing)

443 TCP Hypertext Transfer Protocol Secure HTTPS (Secure Web Browsing)

22 TCP Secure Shell SSH (Remote Access)

21 TCP File Transfer Protocol FTP (File Transfer)

25 TCP Simple Mail Transfer Protocol SMTP (Email Sending)

53 UDP/TCP Domain Name System DNS (Domain Name Resolution)

67 UDP Dynamic Host Configuration Protocol DHCP (IP Address Assignment)


IP ADDRESS
Java Institute

INTERNET PROTOCOL
ADDRESS
Java Institute

What is an IP Address?
An IP address (Internet Protocol address) is a unique numerical identifier
assigned to every device connected to a network.
It allows devices to communicate and share data over the internet or local
networks.

Purpose:
Device Identification: Uniquely identifies a device (e.g., computer, smartphone,
server) on a network.
Location Addressing: Provides the location of the device, enabling data to be
routed to and from it.
Java Institute

Analogy
Think of an IP address as a home address for
your device.
Just as a postal address ensures mail reaches the
correct house, an IP address ensures data
reaches the correct device.

Example:
When you visit a website (e.g., www.google.com),
your device uses the website’s IP address (e.g.,
142.250.190.14) to connect to it.
Java Institute

Types of IP Addresses
Java Institute

Public IP Addresses
A public IP address is a unique address assigned to a device or network that is
accessible over the internet. It is globally unique and allows devices to communicate
across the internet.

Purpose: Used to identify devices or networks on the internet, enabling


communication between different networks.
Assignment: Assigned by an Internet Service Provider (ISP)
Scope: Accessible from anywhere on the internet.
Use Cases:
Hosting websites, servers, or applications.
Enabling remote access to devices or networks.
Facilitating communication between devices over the internet.
Java Institute

Private IP Addresses
A private IP address is used within a local network (e.g., home, office, or organization)
and is not accessible over the internet. It allows devices within the same network to
communicate with each other.

Purpose: Used for internal communication within a private network.


Assignment: Assigned by a router or network administrator using DHCP or
manual configuration.
Scope: Only accessible within the local network; not routable on the internet.
Use Cases:
Connecting devices like computers, printers, and smartphones within a home
or office network.
Internal communication in organizations.
Java Institute

Static IP Addresses
A static IP address is a fixed address that does not change over time. It is manually
configured and remains constant for a device or network.

Purpose: Used for devices or services that require a consistent and unchanging
address.
Assignment: Manually configured by a network administrator or ISP.
Scope: Can be either public (accessible over the internet) or private (used within a
local network).
Use Cases:
Hosting websites, email servers, or databases.
Remote access to devices (e.g., VPNs).
Devices that need a permanent address (e.g., network printers, security
cameras).
Java Institute

Dynamic IP Addresses

A dynamic IP address is an address that is automatically assigned to a device by a


DHCP (Dynamic Host Configuration Protocol) server and can change over time.

Purpose: Used for devices that do not require a fixed address and can work with a
temporary address.
Assignment: Automatically assigned by a DHCP server (e.g., a router or ISP).
Scope: Can be either public (assigned by an ISP) or private (assigned by a local
router).
Use Cases:
General-purpose devices like laptops, smartphones, and IoT devices.
Home internet connections where a fixed IP is not required.
Java Institute

Example Scenarios:
Public Static IP: A web server hosting a website needs a public static IP so users
can always access it using the same address.

Public Dynamic IP: A home internet connection might have a public dynamic IP
assigned by the ISP, which changes periodically.

Private Static IP: A network printer in an office might have a private static IP for
consistent access within the local network.

Private Dynamic IP: A smartphone connected to a Wi-Fi network might receive a


private dynamic IP from the router.
Java Institute

IPv4 (Internet Protocol Version 4)


IPv4 is the fourth version of the Internet Protocol and is the most widely used
protocol for identifying and communicating with devices on a network.
It uses a 32-bit address scheme, allowing for approximately 4.3 billion unique
addresses.

IPv4 Address Format


An IPv4 address consists of four
octets (8 bits each), separated by
dots. (dot-decimal notation.)
Each octet ranges from 0 to 255.
Example: 192.168.1.1
Java Institute

IPv6 (Internet Protocol Version 6)


IPv6 is the most recent version of the Internet Protocol, designed to replace IPv4.
It was developed to address the limitations of IPv4,
particularly its limited address space. IPv6 uses a 128-bit address scheme, providing
a vastly larger number of unique addresses and introducing several improvements
over IPv4.
Pv6 provides approximately 340
undecillion (3.4 × 10^38) unique
addresses, ensuring the internet can
grow indefinitely.
Java Institute

IPv6 Address Format

IPv6 addresses are written in hexadecimal and divided into eight groups of four
digits, separated by colons.

Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Leading zeros in each group can be omitted, and consecutive groups of zeros can
be replaced with :: (once per address).

Simplified example: 2001:db8:85a3::8a2e:370:7334


Java Institute

Aspect IPv4 IPv6

Address Length 32-bit address. 128-bit address.

Decimal format, separated by dots Hexadecimal format, separated by colons


Representation
(e.g., 192.168.1.1). (e.g., 2001:0db8:85a3::8a2e:0370:7334).

Example 192.168.1.1 2001:0db8:85a3::8a2e:0370:7334

Total Addresses Approximately 4.3 billion (2^32). Approximately 340 undecillion (2^128).

Adoption Widely used Growing adoption


Java Institute

Classes of IPv4 Addresses


IPv4 addresses are divided into five classes: A, B, C, D, and E. Each class is designed for
specific types of networks and has a defined range of IP addresses.

Purpose:
Device Identification: Uniquely identifies a device (e.g., computer, smartphone,
server) on a network.
Location Addressing: Provides the location of the device, enabling data to be
routed to and from it.
Java Institute

Class A IP Addresses
Class A IP addresses are designed for very large networks, such as those used by
multinational corporations or internet service providers (ISPs). They provide a large
number of host addresses per network, making them suitable for organizations with
a significant number of devices. However, Class A addresses are no longer widely
used. They were officially retired in 2010.

Key Features of Class A IP Addresses


Range:
First Octet: 1 to 126
Total Range: 1.0.0.0 to 126.0.0.0
Network and Host Bits:
Network Bits: First 8 bits (1 octet).
Host Bits: Last 24 bits (3 octets).
Java Institute

8 BITS 24 BITS

NETWORK HOST HOST HOST

00000001 00000000 00000000 00000000


Java Institute

Reserved Addresses in Class A

1. 0.0.0.0
Represents the default network.

127.0.0.0 to 127.255.255.255

Reserved for loopback addresses (e.g., 127.0.0.1 for localhost).


Java Institute

Class B IP Addresses
Class B IP addresses are designed for medium to large networks, such as those used
by universities, large businesses, or organizations with a significant number of
devices. They strike a balance between the number of networks and the number of
hosts per network, making them suitable for organizations that need more networks
than Class A but fewer hosts per network. However, Class B addresses are no longer
widely used. They were officially retired in 2010.

Key Features of Class B IP Addresses


Range:
First Octet: 128 to 191
Total Range: 128.0.0.0 to 191.255.0.0
Network and Host Bits:
Network Bits: First 16 bits (2 octets).
Host Bits: Last 16 bits (2 octets).
Java Institute

16 BITS 16 BITS

NETWORK NETWORK HOST HOST

10000001 00000001 00000000 00000000


Java Institute

Class C IP Addresses
Class C IP addresses are designed for small to medium-sized networks, such as
those used by small businesses, home networks, or organizations with a limited
number of devices. They provide a large number of networks but fewer hosts per
network, making them ideal for smaller-scale deployments.
Public Class C:192.168.1.1 (used by organizations or ISPs).
Private Class C:192.168.1.1 (used for internal networks).

Key Features of Class C IP Addresses


Range:
First Octet: 192 to 223
Total Range: 192.0.0.0 to 223.255.255.0
Network and Host Bits:
Network Bits: First 24 bits (3 octets).
Host Bits: Last 8 bits (1 octet).
Java Institute

24 BITS 8 BITS

NETWORK NETWORK NETWORK HOST

11000000 00000000 00000001 00000000


Java Institute

Class D IP Addresses
Class D IP addresses are reserved for multicast communication, which is a one-to-
many or many-to-many communication model. Unlike Class A, B, and C addresses,
which are used for unicast communication (one-to-one), Class D addresses are
used to send data to multiple devices simultaneously.
Video Streaming:Multicast is used to deliver live video streams to multiple viewers.
Online Gaming:Game servers use multicast to send updates to multiple players.

Key Features of Class C IP Addresses


Range:
First Octet: 224 to 239
Total Range: 224.0.0.0 to 239.255.255.255
Purpose:
Used for multicast communication, where data is sent to a group of devices
rather than a single device.
Java Institute

32 BITS

NETWORK NETWORK NETWORK NETWORK

11100000 00000000 00000000 00000000


Java Institute

Class E IP Addresses
Class E IP addresses are reserved for experimental and future use. Unlike Class A, B, C, and D
addresses, which are used for specific purposes (unicast and multicast communication), Class E
addresses are not assigned to devices or networks. They are set aside for research, development,
and potential future applications.
Research and Development:Used by researchers to test new networking protocols, technologies,
and applications.
Future Use:Reserved for potential future applications that may require a new class of IP
addresses.

Key Features of Class C IP Addresses


Range:
First Octet: 240 to 255
Total Range: 240.0.0.0 to 255.255.255.255
Purpose:
Reserved for experimental, research, and future use.
Not used for general-purpose networking or communication.
Java Institute

27 BITS

11110000 00000000 00000001 00000000


Achira Dasanayaka

THANK YOU
[email protected]
Java Institute

End Slide

You might also like