You are on page 1of 21

What is switching?

Switched communication networks are those in which data transformed from source to
destination is routed between various intermediate nodes.

There are mainly three typical Switching Techniques available for digital traffic:

1. Circuit Switching
2. Packet Switching

Switched communications networks


A switched communications network transfers data from source to destination through a series of network
nodes. Switching can be done in one of two ways. In a circuit-switched network, a dedicated physical path
is established through the network and is held for as long as communication is necessary. An example of
this type of network is the traditional (analog) telephone system. A packet-switched network, on the other
hand, routes digital data in small pieces called packets, each of which proceeds independently through the
network. Long distance transmission between stations (called “end devices”) is typically done over a
network of switching nodes. Switching nodes do not concern with content of data. Their purpose is to
provide a switching facility that will move the data from node to node until they reach their destination
(the end device). A collection of nodes and connections forms a communications network.

Two different switching technologies

1. Circuit switching
2. Packet switching

Circuit Switching

 Circuit switching is a switching technique that establishes a dedicated path between sender and
receiver.
 In the Circuit Switching Technique, once the connection is established then the dedicated path will
remain to exist until the connection is terminated.
 Circuit switching in a network operates in a similar way as the telephone works.
 A complete end-to-end path must exist before the communication takes place.
 In case of circuit switching technique, when any user wants to send the data, voice, video, a request
signal is sent to the receiver then the receiver sends back the acknowledgment to ensure the
availability of the dedicated path. After receiving the acknowledgment, dedicated path transfers
the data.
 Circuit switching is used in public telephone network. It is used for voice transmission.
 Fixed data can be transferred at a time in circuit switching technology.

Communication through circuit switching has 3 phases:

1. Circuit establishment
2. Data transfer
3. Circuit Disconnect

Advantages of Circuit Switching:

 In the case of Circuit Switching technique, the communication channel is dedicated.


 It has fixed bandwidth.

Disadvantages of Circuit Switching:


 Once the dedicated path is established, the only delay occurs in the speed of data transmission.
 It takes a long time to establish a connection approx 10 seconds during which no data can be
transmitted.
 It is more expensive than other switching techniques as a dedicated path is required for each
connection.
 It is inefficient to use because once the path is established and no data is transferred, then the
capacity of the path is wasted.
 In this case, the connection is dedicated therefore no other data can be transferred even if the
channel is free.

Packet Switching

 Packet switching can be seen as a solution that tries to combine the advantages of message and
circuit switching and to minimize the disadvantages of both.
 There are two methods of packet switching: Datagram and virtual circuit.
 In both packet switching methods, a message is broken into small parts, called packets.
 Every packet contains some information in its headers such as source address, destination address
and sequence number.
 Packets will travel across the network, taking the shortest path as possible.
 All the packets are reassembled at the receiving end in correct order.
 If any packet is missing or corrupted, then the message will be sent to resend the message.
 If the correct order of the packets is reached, then the acknowledgment message will be sent.
Advantages of Packet Switching:

Cost-effective: In packet switching technique, switching devices do not require massive secondary storage
to store the packets, so cost is minimized to some extent. Therefore, we can say that the packet switching
technique is a cost-effective technique.

Reliable: If any node is busy, then the packets can be rerouted. This ensures that the Packet Switching
technique provides reliable communication.

Efficient: Packet Switching is an efficient technique. It does not require any established path prior to the
transmission, and many users can use the same communication channel simultaneously, hence makes use
of available bandwidth very efficiently.

Datagram Packet switching:


It is a packet switching technology in which packet is known as a datagram, is considered as an
independent entity. Each packet contains the information about the destination and switch uses this
information to forward the packet to the correct destination.
The packets are reassembled at the receiving end in correct order.
In Datagram Packet Switching technique, the path is not fixed.
Intermediate nodes take the routing decisions to forward the packets.
Datagram Packet Switching is also known as connectionless switching.

Virtual Circuit Switching


Virtual Circuit Switching is also known as connection-oriented switching.
In the case of Virtual circuit switching, a preplanned route is established before the messages are sent.
Call request and call accept packets are used to establish the connection between sender and receiver.
In this case, the path is fixed for the duration of a logical connection.

Let's understand the concept of virtual circuit switching through a diagram

In the above diagram, A and B are the sender and receiver respectively. 1 and 2 are the nodes.
Call request and call accept packets are used to establish a connection between the sender and receiver.
When a route is established, data will be transferred.
After transmission of data, an acknowledgment signal is sent by the receiver that the message has been
received.
If the user wants to terminate the connection, a clear signal is sent for the termination.
Differences b/w Datagram approach and Virtual Circuit approach

Datagram approach Virtual Circuit approach

Node takes routing decisions Node does not take any routing decision.
to forward the packets.

Congestion cannot occur as all Congestion can occur when the node is busy, and it does
the packets travel in different not allow other packets to pass through.
directions.

It is more flexible as all the It is not very flexible.


packets are treated as an
independent entity.

LAN Technologies
Local Area Network (LAN) is a data communication network connecting various terminals or computers
within a building or limited geographical area. The connection among the devices could be wired or
wireless. Ethernet, Fast Ethernet, Gigabit Ethernet and 10Gig Ethernet, Wireless LAN using IEEE 802.11 are
examples of standard LAN technologies

MAC:
This protocol controls which gadgets can transmit information to the system, and when they can do so
The Data Link Layer is divided into two Part MAC Media Access Control) Sublayer and LLC (Logic Link
Control) Sublayer.

Ethernet
Ethernet is the LAN technology most commonly used today. Ethernet has become popular because of its
modest price; Ethernet cable is inexpensive and easily installed. Ethernet network adapters and Ethernet
hardware components are also relatively inexpensive.

On Ethernet networks, all computers share a common transmission medium. Ethernet uses an access
method called Carrier Sense Multiple Access with Collision Detect (CSMA/CD) for determining when a
computer is free to transmit data on to the access medium. Using CSMA/CD, all computers monitor the
transmission medium and wait until the line is available before transmitting. If two computers try to
transmit at the same time, a collision occurs. The computers then stop, wait for a random time interval,
and attempt to transmit again.
CSMA/CD can be compared to the protocol followed by a room full of polite people. Someone who wants
to speak first listens to determine whether anybody else is currently speaking (this is the Carrier Sense). If
two people start speaking at the same moment, both people will detect the problem, stop speaking, and
wait before speaking again (this is Collision Detect)

Ethernet Address
 End nodes are identified by their Ethernet Addresses (MAC Address or Hardware Address) which is
a unique 6 Byte address.
 MAC Address is represented in Hexa Decimal format e.g 00:05:5D:FE:10:0A
 The first 3 bytes identify a vendor (also called prefix) and the last 3 bytes are unique for every host
or device

Ethernet Frame Structure


Preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011
Used to synchronize receiver, sender clock rates
Addresses: 6 bytes, frame is received by all adapters on a LAN and dropped if address does not match
Length: 2 bytes, length of Data field
CRC: 4 bytes generated using CR-32, checked at receiver, if error is detected, the frame is simply dropped
Data Payload: Maximum 1500 bytes, minimum 46 bytes
If data is less than 46 bytes, pad with zeros to 46 bytes

10 Base 5 (Thicknet) (Bus Topology) Length


10 Base 2 (Thinnet) (Bus Topology)
10 Base T (UTP) (Star/Tree Topology)
10 Base FL (Fiber) (Star/Tree Topology)

Ethernet BUS Topology

Ethernet STAR Topology


Physical Media :-
10 Base5 - Thick Co-axial Cable with Bus Topology
10 Base2 - Thin Co-axial Cable with Bus Topology
10 BaseT - UTP Cat 3/5 with Tree Topology
10 BaseFL - Multimode/Singlemode Fiber with Tree
Topology

Maximum Segment Length


10 Base5 - 500 m with at most 4 repeaters (Use Bridge to extend
the network)
10 Base2 - 185 m with at most 4 repeaters (Use Bridge to extend
the network)
10 BaseT - 100 m with at most 4 hubs (Use Switch to extend the
network)
Fast Ethernet- the Ethernet working at the speed of 100Mbps is referred as fast Ethernet.
100 Mbps bandwidth
Uses same CSMA/CD media access protocol and packet format as in Ethernet.
100BaseTX (UTP) and 100BaseFX (Fiber) standards
Physical media:-
100 Base TX - UTP Cat 5e
100 Base FX - Multimode / Single mode Fiber
Full Duplex/Half Duplex operations

Provision for Auto-Negotiation of media speed:


10 Mbps or 100Mbps (popularly available for copper media only).

Maximum Segment Length


100 Base TX - 100 m
100 Base FX - 2 Km (Multimode Fiber)
100 Base FX - 20 km (Single mode Fiber)

Gigabit Ethernet
1 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in Ethernet and is backward compatible (10/100/100
modules are available).
1000BaseT (UTP), 1000BaseSX (Multimode Fiber) and 1000BaseLX (Multimode/Singlemode Fiber)
standards.
Maximum Segment Length
1000 Base T - 100m (Cat 5e/6)
1000 Base SX - 275 m (Multimode Fiber)
1000 Base LX - 512 m (Multimode Fiber)
1000 Base LX - 20 Km (Single mode Fiber)
1000 Base LH - 80 Km (Single mode Fiber)
10 Gig Ethernet
10 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in Ethernet.
Propositioned for Metro-Ethernet
Maximum Segment Length
1000 Base-T - Not available
10GBase-LR - 10 Km (Singlemode Fiber)
10GBase-ER - 40 Km (Singlemode Fiber)
802.11 Wireless LAN

Wireless LANs are those Local Area Networks that use high frequency radio waves instead of cables for
connecting the devices in LAN. Users connected by WLANs can move around within the area of network
coverage. Most WLANs are based upon the standard IEEE 802.11.

AP (Access Point)
An Access Point (AP) is installed to act as Bridge between Wireless and Wired Network. The AP is
connected to wired network and is equipped with antennae to provide wireless connectivity
Range (Distance between Access Point and WLAN client) depends on structural hindrances and RF gain of
the antenna at the Access Point

Hand-Off
A client is always associated with one AP and when the client moves closer to another AP, it associates
with the new AP called Hand-Off. In other words Hand-Off occurs when a client moves beyond the radio
range of one AP, and into the range of another AP.

Three flavors of WLAN 802.11:


1. 802.11b
2. 802.11a
3. 802.11g

802.11b
The most popular 802.11 standard currently in deployment, and provides 1, 2, 5.5 and 11 Mbps
data rates in the 2.4 GHz ISM (Industrial-Scientific-Medical) band.

802.11a
802.11a — an extension to 802.11 that applies to wireless LANs and provides data rate up to 54-
Mbps in the 5GHz band.

802.11g
Applies to wireless LANs and is used for transmission over short distances at up to 54-Mbps in the
2.4 GHz bands

Network Interface Controller


Basic Service Set (BSS): A basic service set is a group of stations communicating at physical layer level.
BSS can be of two categories depending upon mode of operation.

• Type networks Ad Hoc, where stations communicate directly;


• Infrastructure type networks where stations communicate through access points.
Extended Service Set (ESS): An extended service set is created by joining two or more basic service
sets (BSS) having access points (APs)

Multiple Access with Collision Avoidance (MACA)


Multiple Access with Collision Avoidance (MACA) is a medium access control (MAC) layer protocol used in
wireless networks, with a view to solve the hidden terminal problem. It also provides solution to the
exposed terminal problem. The MAC layer protocol IEEE 802.11 RTS/CTS has been adopted from MACA.

Working Principle
Before every data transmission
 Sender sends a Request to Send (RTS) frame containing the length of the transmission
 Receiver respond with a Clear to Send (CTS) frame
 Sender sends data
 Receiver sends an ACK; now another sender can send data
When sender doesn’t get a CTS back, it assumes collision

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA): is a network protocol
In contrast to CSMA/CD (Carrier Sense Multiple Access/Collision Detection) that deals with
collisions after their occurrence, CSMA/CA prevents collisions prior to their occurrence.
The algorithm of CSMA/CA is:
 When a frame is ready, the transmitting station checks whether the channel is idle or
busy.
 If the channel is busy, the station waits until the channel becomes idle.
 If the channel is idle, the station waits for an Inter-frame gap (IFG) amount of time
and then sends the frame.
 After sending the frame, it sets a timer.
 The station then waits for acknowledgement from the receiver. If it receives the
acknowledgement before expiry of timer, it marks a successful transmission.
 Otherwise, it waits for a back-off time period and restarts the algorithm.
 The following flowchart summarizes the algorithms:
Bluetooth is a wireless LAN technology designed to connect devices of different functions such as
telephones, notebooks, computers, cameras, printers, coffee makers, and so on. A Bluetooth LAN is an ad
hoc network, which means that the network is formed spontaneously.

Piconet and Scatternet


A piconet is the type of connection that is formed between two or more Bluetooth-enabled devices such as
modern cell phones or PDAs. Bluetooth enabled devices are "peer units" in that they are able to act as
either master or slave. However, when a piconet is formed between two or more devices, one device takes
the role of 'master', and all other devices assume a 'slave' role for synchronization reasons. Piconets have a
7 member address space (3 bits, with zero reserved for broadcast), which limits the maximum size of a
piconet to 8 devices, i.e. 1 master and 7 slaves.

A scatternet is a number of interconnected piconets that supports communication between more than 8
devices. Scatternets can be formed when a member of one piconet (either the master or one of the slaves)
elects to participate as a slave in a second, separate piconet.

Transport Layer
The transport layer is responsible for process-to-process delivery—the delivery of a
packet, part of a message, from one process to another. Two processes communicate in a client/server
relationship.

Port numbers v/s IP address


In both TCP and UDP, the port numbers are 16-bit integers between 0 and 65,535. It is part of the
addressing information used to identify the senders and receivers of messages. These port numbers allows
different applications on the same computer to share network resources simultaneously. Process to
Process delivery needs two identifiers, IP address, and port number, at each end to make a connection. IP
Address selects the host and port number selects the process.

(IANA* Ranges) Internet Assigned Number Authority

 Well Known Ports: 0 to 1023


 Registered Ports: 1024 to 49,151
 Dynamic Ports: 49,152 to 65,535
Socket Addresses
Socket address is the combinations of IP address and port number as shown in the figure

 The client socket address defines the client process uniquely whereas the server socket address
defines the server process uniquely.
 A transport layer protocol requires the client socket address as well as the server socket address.
These two addresses contain four pieces.
 These four pieces go into the IP header and the transport layer protocol header.
 The IP header contains the IP addresses while the UDP and TCP headers contain the port numbers.

TCP and UDP


The transport layer is where data is encapsulated into segments. These segments are then sent using
either TCP or UDP protocols.

TCP is a connection-oriented protocol, which means the sender does not send any data to the destination
node until the destination node acknowledges that it is listening to the sender. TCP is a connection-
oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses
flow and error control mechanisms at the transport level. TCP covers parts of Layer 4, the Transport Layer,
and parts of Layer 5, the Session Layer.
For example, when a Web server sends an HTML file to a client, it uses the HTTP protocol to do so. The
HTTP program layer asks the TCP layer to set up the connection and send the file. The TCP stack divides
the file into packets, numbers them and then forwards them individually to the IP layer for delivery.
Although each packet in the transmission will have the same source and destination IP addresses, packets
may be sent along multiple routes. The TCP program layer in the client computer waits until all of the
packets have arrived, then acknowledges those it receives and asks for the retransmission on any it does
not (based on missing packet numbers), then assembles them into a file and delivers the file to the
receiving application.

TCP Header
The length of TCP header is minimum 20 bytes long and maximum 60 bytes.
Source port address: A 16-bit value that defines the port number of the application program in the host
that is sending the segment
Destination port address: A 16-bit value that defines the port number of the application program in the
host that is receiving the segment
Sequence number: A 32-bit value that defines the number assigned to the first byte of data contained in
this segment
Acknowledge number: A 16-bit value that defines the byte number that the sender of the segment is
expecting to receive from the other party
Header length: A 4-bit value that indicates the number of 4-byte words in the TCP header
Reserved: A 6-bit field reserved for future use
Control: A 6-bit field that defines 6 different control bits or flags, as shown in figure
Window size: A 16-bit value in bytes that the other party must maintain
Checksum: A 16-bit checksum; its calculation follows the UDP procedure
Urgent pointer: A 16-bit value, which is valid only if the urgent flag is set, is used when the segment
contains urgent data
Options: There can be up to 40 bytes of optional information in the TCP header

Control Field (Reserved 6 bit)

URG - It indicates that Urgent Pointer field has significant data and should be processed.
ACK - It indicates that Acknowledgement field has significance. If ACK is cleared to 0, it indicates that
packet does not contain any acknowledgement.
PSH - When set, it is a request to the receiving station to PUSH data (as soon as it comes) to the receiving
application without buffering it.
RST - Reset flag has the following features:
1. It is used to refuse an incoming connection.
2. It is used to reject a segment.
3. It is used to restart a connection.
SYN - This flag is used to set up a connection between hosts.
FIN - This flag is used to release a connection and no more data is exchanged thereafter. Because packets
with SYN and FIN flags have sequence numbers, they are processed in correct order.

TCP three-way handshake


Since TCP is a connection-oriented protocol, a connection needs to be established before two devices can
communicate. TCP uses a process called three-way handshake to negotiate the sequence and
acknowledgment fields and start the session. Here is a graphical representation of the process.
As the name implies, the three ways handshake process consists of three steps:
1. Host A initiates the connection by sending the TCP SYN packet to the destination host. The packet
contains the random sequence number (e.g. 5432) which marks the beginning of the sequence
numbers for data that the Host A will transmit.
2. The Server receives the packet and responds with its own sequence number. The response also
includes the acknowledgment number, which is Host A’s sequence number incremented by 1 (in
our case, that would be 5433).
3. Host A acknowledges the response of the Server by sending the acknowledgment number, which is
the Server’s sequence number incremented by 1.

Here is another picture with the numbers included:

After the data transmission process is finished, TCP will terminate the connection between two endpoints.

Critical components of TCP Header include:


 TCP flags
 Initial Sequence Number (ISN)
 Source and destination port

Let’s define ISN as a 32-bit number that tracks the packets received by the node and enables the
reassembly of large packets that have been broken up into smaller packets.
Two hosts exchange their ISNs during steps 1 and 2 of the TCP three-way handshake.

Protocols in Layered Architecture

1. TCP/IP Network Layer Protocols


Internet Protocol version 4 (IPv4) is a Network layer protocol that provides source and destination
addressing and routing for the TCP/IP suite
Connectionless protocol; fast but unreliable
Internet Control Message Protocol (ICMP) is a Network layer protocol used to send error and control
messages between systems or devices
The Ping utility uses ICMP to request a response from a remote host to verify availability
Address Resolution Protocol (ARP) resolves logical (IP) addresses to physical (MAC) addresses

2. Transport Protocols
Transport protocols can be connection-oriented (reliable) or connectionless (best-effort) delivery
Transmission Control Protocol (TCP) Responsible for reliable data delivery in TCP/IP
Sequential Packet Exchange (SPX) Novell’s connection-oriented protocol used to guarantee data
delivery
NetBIOS/NetBEUI NetBIOS establishes/manages communications between computers and provides
naming services. NetBEUI provides data transport services for these communications
3. Application Layer Protocols
Domain Name System (DNS) Session layer name-to-address resolution protocol
Hypertext Transport Protocol (HTTP) To transfer Web pages from Web server to browser
File Transfer Protocol (FTP) For file transfer and directory and file manipulation
Telnet Remote terminal emulation; operates at layers 7-5
Simple Mail Transport Protocol (SMTP) Operates at layers 7-5; provides messaging services

UDP User Datagram Protocol


The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add
anything to the services of IP except to provide process-to-process communication instead of host-to-host
communication. In UDP, the receiver does not generate an acknowledgement of packet received and in
turn, the sender does not wait for any acknowledgement of packet sent. This shortcoming makes this
protocol unreliable as well as easier on processing.

UDP Header
UDP header is as simple as its function.

UDP header contains four main parameters:


 Source Port - This 16 bits information is used to identify the source port of the packet.
 Destination Port - This 16 bits information, is used identify application level service on destination
machine.
 Length - Length field specifies the entire length of UDP packet (including header). It is 16-bits field and
minimum value is 8-byte, i.e. the size of UDP header itself.
 Checksum - This field stores the checksum value generated by the sender before sending. IPv4 has
this field as optional so when checksum field does not contain any value it is made 0 and all its bits are
set to zero.

Multiplexing and De-multiplexing in Transport Layer


Multiplexing and demultiplexing services are provided in almost every protocol architecture ever designed.
UDP and TCP perform the demultiplexing and multiplexing jobs by including two special fields in the
segment headers: the source port number field and the destination port number field.
Multiplexing –
Gathering data from multiple application processes of sender, enveloping that data with header and
sending them as a whole to the intended receiver is called as multiplexing.
Demultiplexing –
Delivering received segments at receiver side to the correct app layer processes is called as demultiplexing.
Introduction of Classful IP Addressing
IP address is an address having information about how to reach a specific host, especially outside the LAN.
An IP address is a 32 bit unique address having an address space of 2 32.
Generally, there are two notations in which IP address is written, dotted decimal notation and hexadecimal
notation.

Subnet Mask
 Consider IP address = 192.168.2.25
 First few bits (left to right) identify network/subnet
 Remaining bits identify host/interface
 Number of subnet bits is called subnet mask, e.g.
 Subnet IP Address range is 192.168.2.0 – 192.168.2.255 or Mask = 255.255.255.0
 Subnet IP Address range is 192.168.2.0 – 192.168.2.15 or Mask = 255.255.255.240

Classful Addressing
The 32 bit IP address is divided into five sub-classes. These are:
 Class A
 Class B
 Class C
 Class D
 Class E
IPv4 address is divided into two parts:
 Network ID
 Host ID
Class A:
IP address belonging to class A are assigned to the networks that contain a large number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.

The higher order bit of the first octet (1 octet=8 bits) in class A is always set to 0. The remaining 7 bits in
first octet are used to determine network ID. The 24 bits of host ID are used to determine the host in any
network. The default subnet mask for class A is 255.x.x.x. Therefore, class A has a total of:
 2^7-2= 126 network ID(Here 2 address is subracted because 0.0.0.0 and 127.x.y.z are special address.
)
 2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x

Class B:
IP address belonging to class B are assigned to the networks that ranges from medium-sized to
large-sized networks.
 The network ID is 16 bits long.
 The host ID is 16 bits long.

The higher order bits of the first octet of IP addresses of class B are always set to 10. The
remaining 14 bits are used to determine network ID. The 16 bits of host ID is used to determine
the host in any network. The default sub-net mask for class B is 255.255.x.x. Class B has a total
of:
 2^14 = 16384 network address
 2^16 – 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.
Class C:
IP address belonging to class C are assigned to small-sized networks.
 The network ID is 24 bits long.
 The host ID is 8 bits long.

The higher order bits of the first octet of IP addresses of class C are always set to 110. The
remaining 21 bits are used to determine network ID. The 8 bits of host ID is used to determine the
host in any network. The default sub-net mask for class C is 255.255.255.x. Class C has a total of:
 2^21 = 2097152 network address
 2^8 – 2 = 254 host address
IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.

Class D:
IP address belonging to class D are reserved for multi-casting. The higher order bits of the first
octet of IP addresses belonging to class D are always set to 1110. The remaining bits are for the
address that interested hosts recognize.
Class D does not posses any sub-net mask. IP addresses belonging to class D ranges from
224.0.0.0 – 239.255.255.255.

Class E:
IP addresses belonging to class E are reserved for experimental and research purposes. IP
addresses of class E ranges from 240.0.0.0 – 255.255.255.254. This class doesn’t have any sub-
net mask. The higher order bits of first octet of class E are always set to 1111.
Rules for assigning Host ID:
Host ID’s are used to identify a host within a network. The host ID are assigned based on the following
rules:
 Within any network, the host ID must be unique to that network.
 Host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent the
network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a
broadcast address to send packets to all the hosts present on that particular network.
Rules for assigning Network ID:
Hosts that are located on the same physical network are identified by the network ID, as all host on the
same physical network is assigned the same network ID. The network ID is assigned based on the following
rules:
 The network ID cannot start with 127 because 127 belongs to class A address and is reserved for
internal loop-back functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore, cannot
be used.
 All bits of network ID set to 0 are used to denote a specific host on the local network and are not
routed and therefore, aren’t used.

Gateway
The Gateway Address is the Address of the router where the packet should be sent in case
the destination host does not belong to the same subnet

IP Header
The IPv4 packet header has quite some fields. In this lesson we’ll take a look at them and I’ll explain what
everything is used for. Take a look at this picture:

Version: the first field tells us which IP version we are using, only IPv4 uses this header so you will always
find decimal value 4 here.
Header Length: this 4 bit field tells us the length of the IP header in 32 bit increments. The minimum length
of an IP header is 20 bytes so with 32 bit increments, you would see value of 5 here. The maximum value
we can create with 4 bits is 15 so with 32 bit increments, that would be a header length of 60 bytes. This
field is also called the Internet Header Length (IHL).
Type of Service: this is used for QoS (Quality of Service). There are 8 bits that we can use to mark the
packet which we can use to give the packet a certain treatment. You can read more about this field in my
IP precedence and DSCP tutorial.
Total Length: this 16-bit field indicates the entire size of the IP packet (header and data) in bytes. The
minimum size is 20 bytes (if you have no data) and the maximum size is 65.535 bytes, that’s the highest
value you can create with 16 bits.
Identification: If the IP packet is fragmented then each fragmented packet will use the same 16 bit
identification number to identify to which IP packet they belong to.
IP Flags: These 3 bits are used for fragmentation:
The first bit is always set to 0.
The second bit is called the DF (Don’t Fragment) bit and indicates that this packet should not be
fragmented.
The third bit is called the MF (More Fragments) bit and is set on all fragmented packets except the last one.
Fragment Offset: this 13 bit field specifies the position of the fragment in the original fragmented IP
packet.
Time to Live: Everytime an IP packet passes through a router, the time to live field is decremented by 1.
Once it hits 0 the router will drop the packet and sends an ICMP time exceeded message to the sender. The
time to live field has 8 bits and is used to prevent packets from looping around forever (if you have a
routing loop).
Protocol: this 8 bit field tells us which protocol is enapsulated in the IP packet, for example TCP has value 6
and UDP has value 17.
Header Checksum: this 16 bit field is used to store a checksum of the header. The receiver can use the
checksum to check if there are any errors in the header.
Source Address: here you will find the 32 bit source IP address.
Destination Address: and here’s the 32 bit destination IP address.
IP Option: this field is not used often, is optional and has a variable length based on the options that were
used. When you use this field, the value in the header length field will increase. An example of a possible
option is “source route” where the sender requests for a certain routing path.

IPv4 and IPv6


 Internet Protocol Version 4 is the most popular protocol in use today, although there are some
questions about its capability to serve the Internet community much longer.
 IPv4 was finished in the 1970s and has started to show its age.
 The main issue surrounding IPv4 is addressing—or, the lack of addressing—because many experts
believe that we are nearly out of the four billion addresses available in IPv4.
 Although this seems like a very large number of addresses, multiple large blocks are given to
government agencies and large organizations.
 IPv6 could be the solution to many problems posed by IPv4
 IPv6 uses 128 bit address instead of 32 bit address.
 The IPv6 addresses are being distributed and are supposed to be used based on geographical
location.
Application Layer
Application layer is present at the top of the OSI model. It is the layer through which users interact. It
provides services to the user.

Application Layer protocol:-

Telnet (Terminal Network)


Developed in the early 1970’s – among the oldest of the application layer protocols and services in the
TCP/IP protocol suite. Telnet is client server application that allows a user to log onto remote machine and
lets the user to access any application program on a remote computer. It is used for managing the files on
the internet. It is used for initial set up of devices like switches. The telnet command is a command that
uses the Telnet protocol to communicate with a remote device or system. Port number of telnet is 23.

File Transfer Protocol (FTP)


FTP stands for file transfer protocol. It is the protocol that actually lets us transfer files.It can facilitate this
between any two machines using it. But FTP is not just a protocol but it is also a program.FTP promotes
sharing of files via remote computers with reliable and efficient data transfer. Port number for FTP is 20 for
data and 21 for control.

Simple Mail Transfer Protocol (SMTP)


The Simple Mail Transfer Protocol (SMTP) is used to transfer electronic mail from one user to another. This
task is done by means of email client software (User Agents) the user is using. User Agents help the user to
type and format the email and store it until internet is available. When an email is submitted to send, the
sending process is handled by Message Transfer Agent which is normally comes inbuilt in email client
software.
Message Transfer Agent uses SMTP to forward the email to another Message Transfer Agent (Server side).
While SMTP is used by end user to only send the emails, the Servers normally use SMTP to send as well as
receive emails. SMTP uses TCP port number 25 and 587.

Domain Name System (DNS)


The Domain Name System (DNS) works on Client Server model. It uses UDP protocol for transport layer
communication. DNS uses hierarchical domain based naming scheme. The DNS server is configured with
Fully Qualified Domain Names (FQDN) and email addresses mapped with their respective Internet Protocol
addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the
corresponding IP address. For example, the domain name www.abc.com might translate to 198.105.232.4.
Port number for DNS is 53

Post Office Protocol (POP3)


The Post Office Protocol version 3 (POP 3) is a simple mail retrieval protocol used by User Agents (client
email software) to retrieve mails from mail server.
When a client needs to retrieve mails from server, it opens a connection with the server on TCP port 110.
User can then access his mails and download them to the local computer. POP3 works in two modes. The
most common mode the delete mode, is to delete the emails from remote server after they are
downloaded to local machines. The second mode, the keep mode, does not delete the email from mail
server and gives the user an option to access mails later on mail server.
Hyper Text Transfer Protocol (HTTP)
The Hyper Text Transfer Protocol (HTTP) is the foundation of World Wide Web. Hypertext is well organized
documentation system which uses hyperlinks to link the pages in the text documents. HTTP works on client
server model. When a user wants to access any HTTP page on the internet, the client machine at user end
initiates a TCP connection to server on port 80. When the server accepts the client request, the client is
authorized to access web pages.

You might also like