0% found this document useful (0 votes)
16 views28 pages

Understanding IP and TCP Protocols

Uploaded by

Nitya Modi
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)
16 views28 pages

Understanding IP and TCP Protocols

Uploaded by

Nitya Modi
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

Internet Principles

IP (Internet Protocol)
• IP is a protocol used to send data from one machine (or device) to
another over the Internet. Data is packaged into units called packets,
which contain both the data being sent and addressing information.
• Packet Structure: Each IP packet includes:
• Destination Address: The address of the machine that is intended to receive
the data.
• Source Address: The address of the machine that is sending the data.
• Data: The actual content being transmitted.
Routing and Intermediary Machines
• Routing: When data is sent, the sending machine does not always
know the best route to the destination. Instead, packets often pass
through multiple intermediary machines known as routers. Routers
direct the packets along the most efficient path to reach their
destination.
• Diverse Networks: The underlying networks can vary widely. Data
packets can be transmitted over different types of networks,
including:
• Wired networks (e.g., Ethernet)
• Wireless networks (e.g., Wi-Fi)
• Telephone systems
• Satellite links
Reliability and Limitations
• No Guarantees: One of the key characteristics of IP is that it does not
guarantee delivery of packets. Just like if a message sent to a cousin
might get stuck if they are unaware of the intended recipient, an IP
packet may not reach its destination. There is no built-in mechanism
to confirm whether the packet arrived successfully.
• Packet Size Limitations: Additionally, there are limitations on the
amount of data that can fit into a single packet. If the data exceeds
this limit, it must be split into multiple packets, which can complicate
the transmission process.
TCP (Transmission Control Protocol)
• TCP addresses the need to send longer messages that exceed the
capacity of a single IP packet (analogous to sending multiple
postcards). It allows for the transmission of larger amounts of data by
breaking it into manageable segments.
• Reliability: TCP ensures that messages are delivered reliably. It
provides mechanisms to confirm that data has been received
correctly, which is essential for applications where data integrity is
critical.
Key Features of TCP
• Sequence Numbers: Each segment of data sent using TCP is assigned a
sequence number. This allows the receiving end to reassemble the
segments in the correct order, even if they arrive out of sequence. This is
particularly useful when messages are sent over multiple days or through
different routes.
• Acknowledgements: When a segment is received, the receiving device
sends back an acknowledgment (ACK) to the sender. This notification
indicates which segments have been successfully received. If the sender
does not receive an acknowledgment for a particular segment, it knows
that the segment may have been lost in transit and can resend it.
• Retransmissions: If a segment is determined to be missing (i.e., no
acknowledgment is received), TCP automatically retransmits that segment.
This ensures that all parts of the message eventually reach the destination
intact.
TCP and IP Combination
• Layered Protocols: TCP is built on top of the IP protocol, meaning that
it relies on IP for the basic transmission of packets across networks.
While IP handles the routing and delivery of packets, TCP adds the
reliability and ordering features necessary for effective
communication.
• Applications Built on TCP: The combination of TCP and IP is
foundational for many Internet services. For example:
• Email: Email protocols (like SMTP) use TCP to ensure that messages are sent
and received reliably.
• HTTP: The Hypertext Transfer Protocol (HTTP), which is used for transmitting
web pages, also relies on TCP to ensure that data is delivered accurately and
in the correct order.
The TCP/IP Protocol Suite
• The low-level protocols at the link layer manage the transfer of bits of
information across a network link. This could be by an Ethernet cable, by
WiFi, or across a telephone network, or even by short-range radio
standards such as IEEE 802.15.4 designed to carry data over the Personal
Area Network (PAN), that is to say between devices carried by an
individual.
• The Internet layer then sits on top of these various links and abstracts
away the gory details in favour of a simple destination address.
• Then TCP, which lives in the transport layer, sits on top of IP and extends it
with more sophisticated control of the messages passed.
• Finally, the application layer contains the protocols that deal with fetching
web pages, sending emails, and Internet telephony. Of these, HTTP is the
most ubiquitous for the web, and indeed for communication between
Internet of Things devices
UDP (User Datagram Protocol)
• As you can see, TCP is not the only protocol in the transport layer.
• Unlike TCP, but as with IP itself, in UDP each message may or may not arrive. No
handshake or retransmission occurs, nor is there any delay to wait for messages in
sequence.
• These limitations make TCP preferable for many of the tasks that Internet of Things
devices will be used for. The lack of overhead, however, makes UDP useful for
applications such as streaming data, which can cope with minor errors but doesn’t
like delays.
• Voice over IP (VoIP)—computer-based telephony, such as Skype—is an example of
this: missing one packet might cause a tiny glitch in the sound quality, but waiting
for several packets to arrive in the right order could make the speech too jittery to
be easy to understand.
• UDP is also the transport for some very important protocols which provide
common, low-level functionality, such as DNS and DHCP, which relate to the
discovery and resolution of devices on the network.
DNS (Domain Name System)
• While computers operate using numerical IP addresses (32-bit
numbers), these addresses are difficult for humans to remember.
DNS provides a way to use familiar domain names (like [Link]
or [Link]) instead of numerical addresses, making it easier for
users to access websites and services.
Structure of Domain Names
• Domain Names: A domain name consists of several parts, including:
• Top-Level Domain (TLD): The last part of the domain name, such as .com, .uk, or .cc.
TLDs categorize domains and help organize the Internet.
• Subdomains: Domains can be further divided into subdomains. For example,
[Link] has bbc as the second-level domain and .[Link] as the TLD.
• [Link]
└── Top-Level Domain (TLD): .com
└── Second-Level Domain: google
└── Subdomain: www
• Hierarchical Structure: The DNS operates in a hierarchical manner. Each TLD
knows where to find information about the domains within it. For example,
the .com TLD knows how to locate [Link] and [Link].
DNS Records and Services
• DNS Records: Each domain has associated DNS records that provide
information about where to direct requests for various services. For
example, the DNS records for [Link] can point to:
• [Link]: The main website.
• [Link]: The service for receiving Gmail.
• [Link]: The service for sending Gmail.
• [Link]: The address of one of Google’s DNS servers.
• Multiple Services: DNS is not limited to web addresses; it can also
direct traffic for various services, such as email and other Internet
applications.
What is an IP Address?
• An IP address is like a digital street address for a device on a network.
Every device that wants to communicate on a network or the internet
needs one.
• Static IP Address
• Dynamic IP Address
Static IP Address
• A static IP is manually assigned and does not change unless someone
reconfigures it.
• It’s ideal for servers or devices that need to be reliably located (e.g., a web
server, printer, or DNS server).
• When you purchase a server-hosting package from an Internet Service
Provider (ISP), you are typically assigned a single IP address. The ISP has a
block of IP addresses that it can allocate to its customers.
• Historical Class-Based Addressing: Historically, IP addresses were divided
into classes based on the number of bits used:
• Class A: Ranges from 0.x.x.x, suitable for large organizations.
• Class B: Ranges from 128.0.x.x, for medium-sized organizations.
• Class C: Ranges from 192.0.0.x, for smaller organizations, with only 256 addresses
available.
• Introduced in 1993, CIDR allows for more flexible allocation of IP
addresses by specifying the number of bits that are fixed. For
example, a Class A address might be represented as [Link]/8, while a
Class C address could be [Link]/24.
• When to Use Static Ips
• For devices that always need to be reached at the same address (e.g.,
servers).
• A system administrator assigns and records each IP manually.
Dynamic IP Address

• A dynamic IP is assigned automatically and temporarily when a


device connects to the network.
• It is managed by DHCP (Dynamic Host Configuration Protocol).
• How It Works:
• You connect a device (laptop, printer, etc.) to your network.
• The device asks the router for an IP address.
• The router assigns an available address from a pool.
• The IP is given as a "lease" — it may expire or change after a while.
Pros of Dynamic IPs
• Easy and automatic setup.
• Efficient use of address space.
• No manual record-keeping needed.

Drawbacks:
• The address may change, so you can’t reliably refer to a device by its
IP long-term (e.g., in DNS entries).
• Not ideal for servers or services that need to be consistently
reachable.
Static IP Address Dynamic IP Address

It is provided by ISP(Internet Service While it is provided by DHCP (Dynamic Host


Provider). Configuration Protocol).

Static IP address does not change any time,


it means if a static IP address is provided While dynamic IP address change any time.
then it can't be changed or modified.

While in dynamic IP address, there is low


Static IP address is less secure.
amount of risk than static IP address's risk.

While dynamic IP address is easy to


Static IP address is difficult to designate.
designate.
Static IP Address Dynamic IP Address
The device designed by static IP address But the device designed by dynamic IP
can be traced. address can't be traced.

Static IP address is more stable than While dynamic IP address is less stable
dynamic IP address. than static IP address.

The cost to maintain the static IP address is While the maintaining cost of dynamic IP
higher than dynamic IP address. address is less than static IP address.

It is used where computational data is less While it is used where data is more
confidential. confidential and needs more security.

Simplifies the troubleshooting as the IP is While dynamic IP increases the complexity


always the same. of diagnosing the network issues.
Limitation of IPv4
• IPv4 Address Space: Pv4 uses 32-bit addresses. IPv4 allows for
approximately 4.3 billion unique IP addresses, which seemed sufficient at
the time of its standardization. However, the rapid growth of
Internet-connected devices has led to the exhaustion of available IPv4
addresses.
• Increasing Device Connectivity: With the proliferation of personal devices
(like smartphones, smartwatches, and health monitors) and household
devices (like security sensors and smart appliances), individuals may have
multiple IP addresses assigned to their various devices. This trend is
expected to continue, leading to potentially tens, hundreds, or even
thousands of connected devices per household.
IPv6
• IPv6 was introduced to address the limitations of IPv4. It uses 128-bit
addresses, which are represented as eight groups of four hexadecimal
digits (e.g., 2001:0db8:85a3:0042:0000:8a2e:0370:7334). The address
space of IPv6 is vast, allowing for unique addresses. This means that
every person on the planet could be assigned a vast number of
addresses without exhausting the available space.
• The development of IPv6 began in the 1980s, and it was officially
released in 1996. Despite its advantages, IPv6 adoption has been
slow, primarily due to the existing infrastructure and the need for
Internet Service Providers (ISPs) to support it.
• Mobile networks are increasingly using IPv6 internally to route traffic,
even if end users are not aware of it. This indicates that there is
already significant underlying infrastructure in place, waiting for
broader adoption.
IPv6
• Many IoT devices will need to be low-power and reliable to function
effectively. The challenge lies in managing the power needs of
potentially large numbers of devices, which may require innovative
solutions.
• To address the power and connectivity challenges, devices may form
mesh networks. The 6LoWPAN (IPv6 over Low Power Wireless
Personal Area Networks) is an IETF working group that proposes
solutions for enabling IPv6 connectivity over low-power wireless
networks, using technologies like IEEE 802.15.4. This approach allows
for efficient communication among numerous low-power devices.
MAC (Media Access Control)
• MAC (Media Access Control) address is a unique hardware identifier assigned to a
network device (like your laptop, phone, or router).
• It operates at the link layer of the TCP/IP stack and is used to identify devices
within a local network (like your home Wi-Fi).
• Format: 48-bit number, shown as six pairs of hexadecimal digits, e.g.
01:23:45:67:89:AB.
• Each device’s network card (e.g., Wi-Fi or Ethernet) typically has a burned-in MAC
address.
• MAC ≠ IP:
• IP address = logical location (can change).
• MAC address = physical identity (usually fixed).
• MACs aren’t used beyond the local network — routers strip and replace them at
each “hop.”
• Devices like Arduino may not come with a built-in MAC, so developers assign one
manually (e.g., from a sticker or reserve pool).
Ports
• Think of a computer as a building, and ports as specific doors or
entrances to rooms inside.
• Each port is identified by a number from 0 to 65535.
• Every internet service (like a website or an email server) "waits" for
connections at a specific port.
• Example:
• Web browsers send HTTP requests to port 80.
• Secure websites (HTTPS) use port 443.
• Custom services might use other ports like 8080 or 4000.
• What Happens if You Use the Wrong Port?
• Nothing is there – the system rejects the connection.
• Firewall silently drops the request.
• The browser blocks it for security.
• The port is open, but expects something else – it gets confused and
disconnects.
• Port Range

Port Range Description


0–1023 Well-known ports (e.g., HTTP, HTTPS, FTP)
1024–49151 Registered ports for common applications
49152–65535 Dynamic/private ports for temporary use
Application Layer
• HTTP
• HTTPS

You might also like