Lecture 02-Data Communication & Network-OSI Model and TCP-IP
Lecture 02-Data Communication & Network-OSI Model and TCP-IP
X Window
Designed for client/server operations, X Window defines a protocol for writing client/server applications based on a graphical user interface
(GUI). The idea is to allow a program, called a client, to run on one computer and have it display things through a window server on another
computer.
What would happen if you wanted to move your web page to a different service provider? The IP address would change and no one would
know what the new one was. DNS allows you to use a domain name to specify an IP address. You can change the IP address as often as you
want and no one will know the difference.
DHCP differs from BootP in that BootP assigns an IP address to a host but the host’s hardware address must be entered manually in a BootP
table. Below is a list of the information a DHCP server can provide:
IP address
Subnet mask
Domain name
Default gateway (routers)
DNS
WINS information
Host-to-Host Layer Protocols
The main purpose of the Host-to-Host layer is to shield the upper-layer applications from the
complexities of the network. This layer says to the upper layer, “Just give me your data stream, with any instructions, and I’ll begin the process
of getting your information ready to send.” The following sections describe the two protocols at this layer:
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
TCP is a full-duplex, connection-oriented, reliable, and accurate protocol. Before a transmitting host starts to send segments down the model,
the sender’s TCP stack contacts the destination’s TCP stack to establish a connection. What is created is known as a virtual circuit. This type
of communication is called connection-oriented. During this initial handshake, the two TCP layers also agree on the amount of information
that’s going to be sent before the recipient’s TCP sends back an acknowledgment. With everything agreed upon in advance, the path is paved
for reliable communication to take place.
TCP Segment Format
Since the upper layers just send a data stream to the protocols in the Transport layers. When the Internet layer receives the data stream, it routes
the segments as packets through an internetwork. The segments are handed to the receiving host’s Host-to-Host layer protocol, which rebuilds
the data stream to hand to the upper-layer applications or protocols.
Source port: The port number of the application on the host sending the data. (Port numbers will be explained a little later in this section.)
Destination port: The port number of the application requested on the destination host.
Sequence number A number used by TCP that puts the data back in the correct order or retransmits missing or damaged data, a process called
sequencing.
Header length: The number of 32-bit words in the TCP header. This indicates where the data begins. The TCP header (even one including
options) is an integral number of 32 bits in length.
Reserved: Always set to zero.
Code bits: Control functions used to set up and terminate a session.
Window The window size the sender is willing to accept, in octets.
Checksum: The cyclic redundancy check (CRC), because TCP doesn’t trust the lower layers and checks everything. The CRC checks the
header and data fields.
Urgent: A valid field only if the Urgent pointer in the code bits is set. If so, this value indicates the offset from the current sequence number,
in octets, where the first segment of non-urgent data begins.
Options: May be 0 or a multiple of 32 bits, if any. What this means is that no options have to be present (option size of 0). However, if any
options are used that do not cause the option field to total a multiple of 32 bits, padding of 0s must be used to make sure the data begins on
a 32-bit boundary.
Data: Handed down to the TCP protocol at the Transport layer, which includes the upper layer headers.
User Datagram Protocol (UDP)
If you were to compare User Datagram Protocol (UDP) with TCP, the former is basically the scaled-down economy model that’s sometimes
referred to as a thin protocol.
UDP does not sequence the segments and does not care in which order the segments arrive at the destination. But after that, UDP sends the
segments off and forgets about them. It doesn’t follow through, check up on them, or even allow for an acknowledgment of safe arrival. Because
of this, it’s referred to as an unreliable protocol. This does not mean that UDP is ineffective, only that it doesn’t handle issues of reliability.
Further, UDP doesn’t create a virtual circuit, nor does it contact the destination before delivering information to it. Because of this, it’s also
considered a connectionless protocol. Since UDP assumes that the application will use its own reliability method, it doesn’t use any. This gives
an application developer a choice when running the Internet Protocol stack: TCP for reliability or UDP for faster transfers. for example, for
Voice over IP (VoIP), you really don’t want to use UDP, because if the segments arrive out of order (very common in IP networks), they’ll
just be passed up to the next OSI (DoD) layer in whatever order they’re received, resulting in some seriously garbled data.
The figure below clearly illustrates UDP’s markedly low overhead as compared to TCP’s hungry usage.
Source port: Port number of the application on the host sending the data
Destination port: Port number of the application requested on the destination host
Length: Length of UDP header and UDP data
Checksum: Checksum of both the UDP header and UDP data fields
Data: Upper-layer data
Port Numbers
TCP and UDP must use port numbers to communicate with the upper layers because they’re what keep track of different conversations crossing
the network simultaneously. Originating source port numbers are dynamically assigned by the source host and will equal some number starting
at 1024. 1023 and below are defined in RFC which discusses what are called well-known port numbers. Virtual circuits that don’t use an
application with a well-known port number are assigned port numbers randomly from a specific range instead. These port numbers identify the
source and destination application or process in the TCP segment.
Internet Layer Protocols
In the DoD model, there are two main reasons for the Internet layer’s existence: routing and providing a single network interface to the upper
layers.
None of the other upper- or lower-layer protocols have any functions relating to routing that complex and important task belongs entirely to
the Internet layer. The Internet layer’s second duty is to provide a single network interface to the upper-layer protocols. The following sections
describe the protocols at the Internet layer:
IP receives segments from the Host-to-Host layer and fragments them into datagrams (packets) if necessary. IP then reassembles datagrams
back into segments on the receiving side. Each datagram is assigned the IP address of the sender and of the recipient. Each router (layer 3
device) that receives a datagram makes routing decisions based on the packet’s destination IP address.
The following fields make up the IP header:
Version: IP version number.
Priority and Type of Service: Type of Service tells how the datagram should be handled. The first 3 bits are the priority bits.
Total length: Length of the packet including header and data. Identification Unique IP-packet value.
Flags: Specifies whether fragmentation should occur.
Fragment offset: Provides fragmentation and reassembly if the packet is too large to put in a frame. It also allows different maximum
transmission units (MTUs) on the Internet.
Time to Live: The time to live is set into a packet when it is originally generated. If it doesn’t get to where it wants to go before the TTL
expires, boom—it’s gone. This stops IP packets from continuously circling the network looking for a home.
Protocol: Port of upper-layer protocol (TCP is port 6 or UDP is port 17 [hex]). Also supports Network layer protocols, like ARP and ICMP.
Can be called Type field in some analyzers.
Destination IP address: 32-bit IP address of the station this packet is destined for.
The Protocol field tells IP to send the data to either TCP port 6 or UDP port 17 (both hex addresses). But it will only be UDP or TCP if the
data is part of a data stream headed for an upper-layer service or application.
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP) works at the Network layer and is used by IP for many different services. ICMP is a management
protocol and messaging service provider for IP. Its messages are carried as IP datagrams.
Ping: Packet Internet Groper (Ping) uses ICMP echo request and reply messages to check the physical and logical connectivity of machines on
an internetwork.
Traceroute: Using ICMP time-outs, Traceroute is used to discover the path a packet takes as it traverses an internetwork.
Here’s how it works: When IP has a datagram to send, it must inform a Network Access protocol, such as Ethernet or Token Ring, of the
destination’s hardware address on the local network. (It has already been informed by upper-layer protocols of the destination’s IP address.) If
IP doesn’t find the destination host’s hardware address in the ARP cache, it uses ARP to find this information.
As IP’s detective, ARP interrogates the local network by sending out a broadcast asking the machine with the specified IP address to reply with
its hardware address. So basically, ARP translates the software (IP) address into a hardware address