Unit 2
Unit 2
UNIT-2
Traditional routing:- In order for routers to direct information packets from the source to
the destination, they need information tables which are called routing tables. The routing table is in the
router control plane. The routing table helps the router to route the information packet from the correct
port to the destination. Routers communicate with each other through routing protocols and help to
complete and update routing tables. Some types of routing protocols are OSPF, IS-IS, EIGRP, BGP. The
information between the routing protocols finally completes the routing tables in the router's control
plane, and this is distributed control plane or distributed routing.
Routing:- Routing is a procedure of moving data packets from one network to another by discovering
the finest path from the source to the destination. The device that helps in finding the best path to
forward data packets from the source of one network to the destination of another network is called
a router.
1
Wireless and mobile computing
2. Default Routing Protocol:-The default routing protocol can also be called the default route.
When a router faces a situation where it does not know the destination network of a data packet, then
it uses a method called "default routing". It is an approach in which the router transfers all data
packets to the single-hop device, regardless of the network.
Interior gateway protocols (IGPs)- They are further categorized into link-state routing protocols,
distance-vector routing protocols, and hybrid routing protocols.
1. Link-state routing protocols:- Link-state routing protocols are a type of interior gateway
protocol which are used in computer networks to decide the most suitable path to send data
packets from one point to another over the network. These protocols have a very good knowledge
of the network topology to forward the data packets to their destination efficiently.
OSPF (Open Shortest Path First):- It is the popular and most widely used open standard protocol. It
was introduced 34 years ago in 1989. It is one of the internal gateway protocols that use a link-state
routing algorithm or shortest path first algorithm that works within a single routing domain. This
algorithm was designed by an expert named Dijkstra, which is why it is also known as Dijkstra Algorithm.
It uses Internet Protocol (IP) type 89 for communication. It supports Classless Inter-Domain
2
Wireless and mobile computing
Routing (CIDR) and Variable Length Subnet Mask (VLSM). It is developed to work with both IPv4 and IPv6
networks. It can divide a larger internetwork into smaller internetwork called areas.
RIP (Routing Information Protocol):- It is one of the oldest dynamic routing protocols. It is a
type of interior gateway protocol used in computer networks, so it performs routing within an
autonomous system. It is a distance-vector routing protocol that uses a hop-count metric to
discover the most suitable route for transmitting data packets to the destination network.
This protocol routinely sends information about routers to their neighbors whenever there is a
modification in the network topology. It is a unicast routing protocol that is used to establish one-
to-one communication in which there will be one sender and one receiver. It supports classful
routing.
There are 2 versions of the routing information protocol: RIP Version 1 (RIPv1) and RIP Version 2 (RIPv2).
RIPv1 is the oldest version of RIP, which is a classful protocol, so it does not support VLSM. It uses the
hop count metric to find the finest path between source and destination. It provides routing updates
periodically to neighboring routers.
RIPv2 is a modern version of RIP, which is a classless routing protocol and supports VLSM. It uses the
hop count metric, but it can hold more information in routing updates. It enhances security by
supporting authentication.
Border Gateway Protocol (BGP):- It is a dynamic routing protocol that is used to figure out the
best path to transfer data packets from one network to another. It is an exterior gateway protocol that
allows routers to exchange information between different autonomous systems. It uses a path-vector
routing protocol, which maintains route details that get updated dynamically.BGP enables efficient
routing to determine the best route to the destination network that provides the most reliable and
faster communication. It is highly scalable as it can seamlessly manage the growing number of
interconnected devices and networks. It supports multi-home connectivity, which means the
organization can connect to multiple internet service providers simultaneously and automatically select
3
Wireless and mobile computing
the best path.BGP provides organizations with control over Internet traffic, which helps avoid congested
routes. BGP enhances internet resilience by quickly adapting to network changes.
An autonomous system is a collection of networks that comes under the single common administrative
domain. Or we can say that it is a collection of routers under the single administrative domain. For
example, an organization can contain multiple routers having different locations, but the single
autonomous number system will recognize them. Within the same autonomous system or same
organization, we generally use IGP (Interior Gateway Protocol) protocols like RIP, IGRP, EIGRP, OSPF.
Suppose we want to communicate between two autonomous systems
4
Wireless and mobile computing
It is a system that contains only one connection from one autonomous system to another autonomous
system. The data traffic cannot be passed through the stub autonomous system. The Stub AS can be
either a source or a sink.
It is an autonomous system that can have more than one connection to another autonomous
system, but it can still be either a source or a sink for data traffic. There is no transient data traffic
flow, which means that the data can be passed from one autonomous system.
The transient autonomous system is a multihomed autonomous system, but it also provides
transient traffic flow.
BGP Tables
There are three types of BGP tables:
Neighbor table: It contains the neighbors who are configured by the administrator manually. The
neighbor relationship has to be manually configured by using the neighbor command.
The above commands are very useful to verify whether the neighbor relationship is up or not.
BGP forwarding table: It contains all the routes advertised in BGP and can be verified using the
following command:
5
Wireless and mobile computing
IP routing table: The IP routing table contains the best path routes required to reach the
destination. The following command shows the best routing path
Length: It is a 16-bit field that defines the total length of the message, including the header.
Multiplexing :- TCP does multiplexing and de-multiplexing at the sender and receiver ends respectively
as a number of logical connections can be established between port numbers over a physical
connection.
6
Wireless and mobile computing
The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there are no
options, a header is 20 bytes else it can be of upmost 60 bytes.
Source Port Address – A 16-bit field that holds the port address of the application that is sending the
data segment.
Destination Port Address – A 16-bit field that holds the port address of the application in the host that
is receiving the data segment.
Sequence Number – A 32-bit field that holds the sequence number, i.e, the byte number of the first
byte that is sent in that particular segment. It is used to reassemble the message at the receiving end of
the segments that are received out of order.
Acknowledgement Number – A 32-bit field that holds the acknowledgement number, i.e, the byte
number that the receiver expects to receive next. It is an acknowledgement for the previous bytes being
received successfully.
Header Length (HLEN) – This is a 4-bit field that indicates the length of the TCP header by a number of
4-byte words in the header
Control flags – These are 6 1-bit control bits that control connection establishment, connection
termination, connection abortion, flow control, mode of transfer etc. Their function is:
7
Wireless and mobile computing
Window size – This field tells the window size of the sending TCP in bytes.
Checksum – This field holds the checksum for error control. It is mandatory in TCP as opposed to UDP.
Urgent pointer – This field (valid only if the URG control flag is set) is used to point to data that is
urgently required that needs to reach the receiving process at the earliest.
Socket:- A socket is one endpoint of a two way communication link between two programs running on
the network. The socket mechanism provides a means of inter-process communication (IPC) by
establishing named contact points between which the communication take place. Like ‘Pipe’ is used to
create pipes and sockets is created using ‘socket’ system call. The socket provides
bidirectional FIFO Communication facility over the network.
Socket are generally employed in client server applications. The server creates a socket, attaches it to a
network port addresses then waits for the client to contact it. The client creates a socket and then
attempts to connect to the server socket. When the connection is established, transfer of data takes
place.
A socket is an endpoint for sending and receiving data in a network, used in both TCP and UDP
communication. Mastering socket programming is key for building network applications.
1.Datagram Socket:- This is a type of network which has connection less point for sending and
receiving packets. It is similar to mailbox.
8
Wireless and mobile computing
Three Way Handshaking: -The TCP 3-Way Handshake is a fundamental process used in
the Transmission Control Protocol (TCP) to establish a reliable connection between a client and a server
before data transmission begins. This handshake ensures that both parties are synchronized and ready
for communication.
3-way Handshake Process:- The process of communication between devices over the internet
happens according to the current TCP/IP suite model(stripped-out version of OSI reference model).
The Application layer is a top pile of a stack of TCP/IP models from where network-referenced
applications like web browsers on the client side establish a connection with the server. From the
application layer, the information is transferred to the transport layer where our topic comes into the
picture
Variable window size and flow:- It solves the scalability issue with ‘receiver window’ or ‘advertised
window’ or ‘user buffer‘ without increasing the size of the ‘Window’ field (which is 16 bits) in the TCP
header. It expands the ‘definition’ of the Window field to 32 bits and then uses a ‘scale factor to carry
this 32-bit value in the 16-bit window field of the TCP header. The scale factor is carried in a new TCP
option called ‘Window Scale’.
Timeout and Retransmission:- To decide what data it needs to resend, TCP depends on a
continuous flow of acknowledgments from receiver to sender.When data segments or
acknowledgments are lost, TCP initiates a retransmission of the data that has not been
acknowledged.TCP has two separate mechanisms for accomplishing retransmission, one based on time
and one based on the structure of the acknowledgments.
TCP sets a timer when it sends data, and if the data is not acknowledged when the timer expires,
a timeout or timer-based retransmission of data occurs.
The timeout occurs after an interval called the retransmission timeout (RTO).
It has another way of initiating a retransmission called fast retransmission or fast retransmit, which
usually happens without any delay.
9
Wireless and mobile computing
when TCP’s cumulative acknowledgment fails to advance in the (duplicate) ACKs received over time, or
when ACKs carrying selective acknowledgment information (SACKs) indicate that out-of-order segments
are present at the receiver.
Since TCP Reno is the extension of TCP Tahoe, the slow start and AIMD phase are the same.
Fast Recovery phase:- It makes use of both RTO and Fast Retransmit. If the packet loss detection is
triggered by 3 duplicate acknowledgments then it is a fast retransmit algorithm in action. On packet loss
detection through Fast Retransmit, cwnd is reduced by 50% (cwnd = cwnd/2). 3 duplicate ACKs are
received that means network is performing well because ACKs are being received which means packets
are getting delivered to the receiver
Sack:- SACK is a sender and receiver side optimization to TCP. Both sender and receiver should support
the SACK feature then only it is possible to use this. SACK feature is enabled by default in all operating
systems i.e. Linux, Windows, and macOS. SACK does not replace the original ACKs in the TCP header but
adds another field in the TCP header’s option field for SACK information.
User Datagram Protocol (UDP):- User Datagram Protocol (UDP) is one of the core protocols of the
Internet Protocol (IP) suite. It is a communication protocol used across the internet for time-sensitive
transmissions such as video playback or DNS lookups . Unlike Transmission Control Protocol (TCP),
UDP is connectionless and does not guarantee delivery, order, or error checking, making it a lightweight
and efficient option for certain types of data transmission.
10
Wireless and mobile computing
UDP Header:- UDP header is an 8-byte fixed and simple header, while for TCP it may vary from 20
bytes to 60 bytes. The first 8 Bytes contain all necessary header information and the remaining part
consists of data.Port numbers help to distinguish different user requests or processes.
Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
Destination Port: It is a 2 Byte long field, used to identify the port of the destined packet.
Length: Length is the length of UDP including the header and the data. It is a 16-bits field.
Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s
complement sum of the UDP header, the pseudo-header of information from the IP header, and the
data, padded with zero octets at the end (if necessary) to make a multiple of two octets.
11
Wireless and mobile computing
UNIT-3
Wireless Local Area Network:- WLAN is a local area network that uses radio communication to
provide mobility to the network users while maintaining the connectivity to the wired network. A WLAN
basically, extends a wired local area network. WLAN’s are built by attaching a device called the access
point(AP) to the edge of the wired network. Clients communicate with the AP using a wireless network
adapter which is similar in function to an ethernet adapter. It is also called a LAWN is a Local area
wireless network.
Types of WLANs
Infrastructure:- In Infrastructure mode, all the endpoints are connected to a base station and
communicate through that; and this can also enable internet access. A WLAN infrastructure can be set
up with: a wireless router (base station) and an endpoint (computer, mobile phone, etc). An office or
home WiFi connection is an example of Infrastructure mode.
Ad Hoc:- In Ad Hoc mode WLAN connects devices without a base station, like a computer workstation.
An Ad Hoc WLAN is easy to set up it provides peer-to-peer communication. It requires two or more
endpoints with built-in radio transmission.
Advantages of WLAN
Disadvantages of WLAN
Slower bandwidth.
Security for wireless LANs is the prime concern.
Less capacity.
Wireless networks cost four times more than wired network cards.
Wireless devices emit low levels of RF which can be harmful to our health.
12
Wireless and mobile computing
Uses:-As we have already have discussed they are used in TV remotes, Pc devices like mice, and
keyboards.
Radio Waves:- The requirement of radio waves is antennas, sending antennas where one can transmit
its message and the other is receiving antennas. The frequency range of radio waves:3KHz – 1GHz. Also,
radio waves of frequency 300KHz-30MHz can travel long distances.
Uses:-Radio waves are used in AM and FM radios, and cordless phones. Also, some private and
government organization reserves certain radio frequencies for direct communication.
Microwaves:-Microwaves are a line of sight transmission, meaning both the antennas sending and
receiving should be properly aligned. Also, the distance covered by the signal is directly proportional to
the height of the antenna. Microwaves have a frequency Range between 1GHz – 300GHz. Basically, we
used Microwaves in mobile phones communication and television distribution.
MAC problems
Hidden Terminal Problem:-A wireless network with lack of centralized control entity, sharing of
wireless bandwidth among network access nodes i.e. medium access control (MAC) nodes must be
organized in decentralized manner. The hidden terminal problem occurs when a terminal is visible from
a wireless access point (APs), but not from other nodes communicating with that AP. This situation leads
the difficulties in medium access control sublayer over wireless networking.
13
Wireless and mobile computing
The transmission range of access point A reaches at B, but not at access point C, similarly transmission
range of access point C reaches B, but not at A. These nodes are known as hidden terminals.
Exposed Terminal Problem:-In wireless LAN (local area network) communication, the exposed
terminal problem is a frequent difficulty. It happens when a wireless node cannot transfer data because
another node that is outside its communication range is sending data to another node that is inside it.
Throughput and network performance may suffer as a consequence. This happens when a station can
be seen by a wireless access point but not by other stations that are connected to the access point.
- Near and far terminals refer to the proximity of wireless stations relative to each other and the access
point.
- Near terminals are stations that are physically close to each other, typically within range of each
other's transmissions.
- Far terminals are stations that are farther away from each other, often within range of the access point
but out of range of direct communication with each other.
14
Wireless and mobile computing
nothing but fixed base stations that are connected by wires. It is impossible for remote localities to
install such a network as it is too expensive. All devices on a wireless network are communicated
through a router i.e. access point. Examples are Wireless LAN, satellite networks, etc.
Ad hoc Networks:-This type of network is a group of independent terminals that communicate with
each other by forming a radio network. The links in wireless networks have less bandwidth as compared
to the wired networks. In this network, each node is act as a router, and network connection is
distributed among nodes. In an ad-hoc network, the formation of networks takes place dynamically with
the help of a collaboration of random nodes. Examples of infrastructure-less networks are Wireless
Sensor Networks(WSN), and Mobile Ad hoc networks (MANETs).
IEEE 802.11 Architecture and Services:- The IEEE 802.11 standard, commonly known as Wi-Fi,
outlines the architecture and defines the MAC and physical layer specifications for wireless LANs
(WLANs). Wi-Fi uses high-frequency radio waves instead of cables for connecting the devices in LAN.
In the year 1990, IEEE 802.11 Committee formed a new working group, the IEEE 802.11 standard which
defines protocols for Wireless Local Area Networks (WLANs). Just like how Ethernet provides services for
wired media, IEEE 802.11 architecture is designed to provide features for wireless networks.
An AP supports both wired and wireless connections. The 802.11 standard calls the upstream wired
network the distribution system (DS). The AP bridges the wireless and wired L2 Ethernet frames,
allowing traffic to flow from the wired to the wireless network and vice versa. Each wireless network has
a unique SSID.The 802.11 architecture provides some basic services for WLANs whose implementation is
supported by MAC layer
Spread Spectrum:-
Spread spectrum is a method of transmitting radio signals over a wide range of frequencies. It spreads
the signal over a broader bandwidth than the minimum required to send the information, which
15
Wireless and mobile computing
provides advantages such as increased resistance to interference, improved security, and enhanced
privacy. The excerpt discusses the use of spread-spectrum techniques in communication to ensure
secure transmission. This method uses air as a medium and extends bandwidth to create a protective
envelope for signals, reducing the risk of interception or jamming. The ‘spread code’ is a patterned
series of numbers that enlarges the original signal’s bandwidth. This method is typically used in
situations where secure transmission is crucial.
Spread Spectrum
To allow redundancy, it is necessary that the bandwidth allocated to each station should be
much larger than needed.
The spreading process occurs after the signal is created by the source.
MAC and its management:- A sublayer of the Data Link Layer (Layer 2) in the OSI (Open Systems
Interconnection) model of computer networking is called Medium Access Control (MAC). Its main duty is
to control access to a network's shared communication medium, ensuring that various devices can
transmit data effectively and fairly over a common communication path like a wired Ethernet or wireless
Wi-Fi network.
Access Control: The MAC layer controls which device can transmit data at any given time by controlling
access to the shared communication medium. It employs various access control techniques to control
how devices compete for access to the medium. Contention-based (like Carrier Sense Multiple Access
with Collision Detection or CSMA/CD) and contention-free (like token passing) techniques can be used.
Frame Addressing: Networked devices on the same network segment are uniquely identified by their
MAC addresses, also called hardware or physical addresses. The MAC layer includes the source and
destination MAC addresses in data frames to identify the sender and recipient of the data.
16
Wireless and mobile computing
Frame Formatting: The MAC layer packages data from the higher layers (typically the Network Layer)
into frames that can be transmitted over the network medium. These frames contain data, control
information, information for checking for errors, and information for addressing.
Error detection: Many MAC protocols include error-checking components to identify transmission
errors. This guarantees the accuracy of the data transmitted through the medium. The MAC layer may
ask for retransmission of the frame if a mistake is found.
Frame detection and collision handling: Collisions can happen when multiple devices try to transmit
data simultaneously over a shared communication medium like Ethernet. Detecting collisions and
putting collision resolution mechanisms into place to lessen their effects falls to the MAC layer. For
instance, when CSMA/CD detects collisions, it starts a back-off mechanism that sends data again after an
arbitrary amount of time has passed.
Flow Control: Some MAC protocols employ flow control to ensure that data is transmitted at a rate the
recipient device can handle without experiencing data loss or overflow. Flow control mechanisms may
use feedback from the receiver to the sender to change transmission rates.
Address Resolution: In Ethernet networks, the MAC layer uses the Address Resolution Protocol (ARP) to
translate addresses from higher layers (like IP addresses) to MAC addresses. The local network
segment's corresponding MAC address is found using ARP, which maps the destination IP address to it.
Broadcast and Multicast: The MAC layer supports both broadcasting and multicasting, allowing for the
sending of frames to various groups of devices (multicast) or all devices on a network segment
(broadcast) as needed.
Security: Some MAC layer protocols include security features like encryption and authentication to
protect data and ensure that only authorized devices can access the network.
Terminologies: -
• Mobile Node (MN): -It is the hand-held communication device that the user caries e.g. Cell phone.
• Home Network: -It is a network to which the mobile node originally belongs to as per its assigned IP
address (home address).
• Home Agent (HA):- It is a router in home network to which the mobile node was originally connected
17
Wireless and mobile computing
• Home Address: It is the permanent IP address assigned to the mobile node (within its home network).
• Foreign Network: It is the current network to which the mobile node is visiting (away from its home
network).
• Foreign Agent (FA): It is a router in foreign network to which mobile node is currently connected. The
packets from the home agent are sent to the foreign agent which delivers it to the mobile node.
• Correspondent Node (CN): It is a device on the internet communicating to the mobile node.
• Care of Address (COA): It is the temporary address used by a mobile node while it is moving away from
its home network.
2. Agent Registration: Mobile node after discovering the foreign agent, sends registration request
(RREQ) to the foreign agent. Foreign agent in turn, sends the registration request to the home agent
with the care-of-address. Home agent sends registration reply (RREP) to the foreign agent. Then it
forwards the registration reply to the mobile node and completes the process of registration.
3.Tunneling: It establishes a virtual pipe for the packets available between a tunnel entry and an
endpoint. It is the process of sending a packet via a tunnel and it is achieved by a mechanism called
encapsulation. It takes place to forward an IP datagram from the home agent to the care-ofaddress.
Whenever home agent receives a packet from correspondent node, it encapsulates the packet with
source address as home address and destination as care-of-address.
18
Wireless and mobile computing
It takes Higher cost and takes more It takes lower cost and does not take
time for deployment. more time for deployment.
Types of routing protocols:- Routing protocols are typically divided into categories like distance
vector, link-state, and hybrid protocols. Distance vector protocols, such as RIP, determine routes based
on the number of hops. Link-state protocols, like OSPF, rely on a more detailed understanding of the
entire network topology.
1. Distance Vector Routing Protocol:-These protocols select the best path on the basis of hop counts
to reach a destination network in a particular direction. Dynamic protocol like RIP is an example of a
distance vector routing protocol. Hop count is each router that occurs in between the source and the
destination network. The path with the least hop count will be chosen as the best path.
Features
19
Wireless and mobile computing
2.Link State Routing Protocol :- These protocols know more about Internetwork than any other
distance vector routing protocol. These are also known as SPF (Shortest Path First) protocol. OSPF is an
example of link-state routing protocol.
Features
Hello, messages, also known as keep-alive messages are used for neighbor discovery and
recovery.
Concept of triggered updates is used i.e updates are triggered only when there is a topology
change.
Only that many updates are exchanged which is requested by the neighbor router.
3. Advanced Distance Vector Routing Protocol:-It is also known as hybrid routing protocol which
uses the concept of both distance vector and link-state routing protocol. Enhanced Interior Gateway
Routing Protocol (EIGRP) is an example of this class of routing protocol. EIGRP acts as a link-state routing
protocol as it uses the concept of Hello protocol for neighbor discovery and forming an adjacency. Also,
partial updates are triggered when a change occurs
Mobile Ad hoc Network (MANET):-nodes do not know the topology of their network, instead they
have to discover it by their own as the topology in the ad-hoc network is dynamic topology. The basic
rules is that a new node whenever enters into an ad-hoc network, must announce its arrival and
presence and should also listen to similar announcement broadcasts made by other mobile nodes.
1. Pro-active routing protocols: These are also known as table-driven routing protocols. Each mobile
node maintains a separate routing table which contains the information of the routes to all the possible
20
Wireless and mobile computing
destination mobile nodes. Since the topology in the mobile ad-hoc network is dynamic, these routing
tables are updated periodically as and when the network topology changes
Destination Sequenced Distance Vector Routing Protocol (DSDV): -It is a pro-active/table driven routing
protocol. It actually extends the distance vector routing protocol of the wired networks as the name
suggests. It is based on the Bellman-ford routing algorithm. Distance vector routing protocol was not
suited for mobile ad-hoc networks due to count-to-infinity problem. Hence, as a solution Destination
Sequenced Distance Vector Routing Protocol (DSDV) came into picture.
Global State Routing (GSR): -It is a pro-active/table driven routing protocol. It actually extends the link
state routing of the wired networks. It is based on the Dijkstra’s routing algorithm. Link state routing
protocol was not suited for mobile ad-hoc networks because in it, each node floods the link state routing
information directly into the whole network i.e. Global flooding which may lead to the congestion of
control packets in the network.
2. Reactive routing protocols:- These are also known as on-demand routing protocol. In this type of
routing, the route is discovered only when it is required/needed. The process of route discovery occurs
by flooding the route request packets throughout the mobile network. It consists of two major phases
namely, route discovery and route maintenance.
Dynamic Source Routing protocol (DSR):- It is a reactive/on-demand routing protocol. In this type of
routing, the route is discovered only when it is required/needed. The process of route discovery occurs
by flooding the route request packets throughout the mobile network. In this protocol, Source node
stores the complete path information and intermediate nodes do not need to maintain routing
information. It consists of two phases:
Route Discovery:- This phase determines the most optimal path for the transmission of data
packets between the source and the destination mobile nodes.
Route Maintenance: -This phase performs the maintenance work of the route as the topology in
the mobile ad-hoc network is dynamic in nature and hence, there are many cases of link
breakage resulting in the network failure between the mobile nodes.
3. Hybrid Routing protocol:- It basically combines the advantages of both, reactive and pro-active
routing protocols. These protocols are adaptive in nature and adapts according to the zone and position
of the source and destination mobile nodes. One of the most popular hybrid routing protocol is Zone
Routing Protocol (ZRP).
21
Wireless and mobile computing
22
Wireless and mobile computing
23