0% found this document useful (0 votes)
27 views

Network Programming

The document discusses TCP/IP protocols including TCP, UDP, IP, ICMP, IGMP, ARP and RARP. It explains that TCP provides reliable transport while UDP is unreliable and datagram-based. IP is used by both TCP and UDP to transmit data across networks. The document also covers IP addressing classes and port numbers.

Uploaded by

Kooky Messi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Network Programming

The document discusses TCP/IP protocols including TCP, UDP, IP, ICMP, IGMP, ARP and RARP. It explains that TCP provides reliable transport while UDP is unreliable and datagram-based. IP is used by both TCP and UDP to transmit data across networks. The document also covers IP addressing classes and port numbers.

Uploaded by

Kooky Messi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

TCP/IP Protocols

Fig. 2.6: Various protocols at the different layers in the TCP/IP protocol suite
Dr. Elhossiny Ibrahim 0 4th year: network programming
TCP/IP Protocols
➢ TCP and UDP are the two predominant transport layer protocols.
Both use IP as the network layer.
➢ TCP provides a reliable transport layer, even though the service it
uses (IP) is unreliable.

➢ UDP sends and receives datagrams for applications.


➢ A datagram is a unit of information (i.e., a certain number of bytes
of information that is specified by the sender) that travels from
the sender to the receiver.
➢ Unlike TCP, however, UDP is unreliable. There is no guarantee that
the datagram ever gets to its final destination.

➢ IP is the main protocol at the network layer. It is used by both


TCP and UDP. Every piece of TCP and UDP data that gets
transferred around an Internet goes through the IP layer at both
end systems and at every intermediate router.

Dr. Elhossiny Ibrahim 1 4th year: network programming


TCP/IP Protocols
➢ In Figure 2.6 we also show an application accessing IP directly.
This is rare, but possible. (Some older routing protocols were
implemented this way. Also, it is possible to experiment with new
transport layer protocols using this feature.)
➢ ICMP is an adjunct to IP. It is used by the IP layer to exchange
error messages and other vital information with the IP layer in
another host or router.
➢ Although ICMP is used primarily by lP, it is possible for an
application to also access it. Two popular diagnostic tools, Ping
and Trace route, both use ICMP.
➢ IGMP is the Internet Group Management Protocol. It is used with
multicasting: sending a UDP datagram to multiple hosts.
➢ ARP (Address Resolution Protocol) and RARP (Reverse Address
Resolution Protocol) are specialized protocols used only with
certain types of network interfaces (such as Ethernet and token
ring) to convert between the addresses used by the IP layer
(logical address) and the addresses used by the network interface
(physical address).

Dr. Elhossiny Ibrahim 2 4th year: network programming


Dr. Elhossiny Ibrahim 3 4th year: network programming
Internet Protocol
(IP address)
➢ Every interface on an Internet must has a unique Internet address (also called
an IP address or logical address).
➢ It provides the location of the host in the network, and thus the capability of
establishing a path to that host
➢ Figure 2.5 shows the five different classes of Internet addresses.
➢ These 32-bit (4 byte) addresses are normally written as four decimal numbers,
one for each byte of the address. This is called dotted-decimal notation.

Fig. 2.5:The five different classes of Internet addresses


Dr. Elhossiny Ibrahim 4 4th year: network programming
Internet Protocol
(IP address)
➢ These addresses are 32-bit numbers. Instead of using a flat address space such
as 1, 2, 3, and so on, there is a structure to Internet addresses.
➢ For example, the class B address of the author’s primary system is
140.252.13.33. The easiest way to differentiate between the different classes of
addresses is to look at the first number of a dotted-decimal address.
➢ The Table shows the different classes.
➢ A multi-homed host will have multiple IP addresses: one per interface.
➢ Since every interface on an Internet must have a unique IP address. There must
be one central authority (Internet Corporation for Assigned Names and
Numbers (ICANN)) for allocating these network addresses connected to the
worldwide Internet.
➢ The assignment of host IDs is up to the system administrator.

➢ There are three types of IP addresses:


➢ Unicast (destined for a single host).
➢ Broadcast (destined for all hosts on
a given network).
➢ Multicast (destined for a set of hosts
that belong to a multicast group).

Dr. Elhossiny Ibrahim 5 4th year: network programming


Internet Protocol
(IP address)

Dr. Elhossiny Ibrahim 6 4th year: network programming


Port Number
➢ TCP and UDP identify applications using 16-bit port numbers.
➢ How are these port numbers chosen?
➢ Servers are normally known by their well-known port number. For example,
every TCP/IP implementation that provides an FTP server provides that service
on TCP port 21.
➢ Every Telnet server is on TCP port 23. Every implementation of TFTP (the Trivial
File Transfer Protocol) is on UDP port 69.
➢ Those services that can be provided by any implementation of TCP/IP have
well-known port numbers between 1 and 1023.
➢ The well-known ports are managed by the Internet Assigned Numbers
Authority (IANA).
➢ A client usually doesn’t care what port number it uses on its end. All it needs to
be certain of is that whatever port number it uses be unique on its host.
➢ Client port numbers are called ephemeral ports (i.e., short lived).
➢ This is because a client typically exists only as long as the user running the
client needs its service, while servers typically run as long as the host is up.
➢ Most TCP/IP implementations allocate port numbers between 1024 and 49151
for user or registered ports.
➢ The port numbers between 49151- 65595 are intended for other servers and
called dynamic or private ports.

Dr. Elhossiny Ibrahim 7 4th year: network programming

You might also like