You are on page 1of 55

ECE458 Communication Networks

Introduction
The term telecommunication means communication at a distance.
The word data refers to information presented in whatever form is agreed upon by the parties creating
and using the data.
Data communications are the exchange of data between two devices via some form of transmission
medium such as a wire cable.
Data Representation: Information today comes in different forms such as text, numbers, images, audio,
and video.

Characteristics of Data Communication


The effectiveness of a data communications system depends on four fundamental characteristics:
1. Delivery. The system must deliver data to the correct destination. Data must be received by the
intended device or user and only by that device or user.
2. Accuracy. The system must deliver the data accurately. Data that have been altered in transmission
and left uncorrected are unusable.
3. Timeliness. The system must deliver data in a timely manner. Data delivered late are useless. In the
case of video and audio, timely delivery means delivering data as they are produced, in the same order
that they are produced, and without significant delay. This kind of delivery is called real-time
transmission.
4. Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery of
audio or video packets. For example, let us assume that video packets are sent every 30 ms. If some of
the packets arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the video is the
result.

Components of Data Communication


1. Message. The message is the information (data) to be communicated. Popular forms of information
include text, numbers, pictures, audio, and video.
2.Sender. The sender is the device that sends the data message. It can be a computer, workstation,
telephone handset, video camera, and so on.
3. Receiver. The receiver is the device that receives the message. It can be a computer, workstation,
telephone handset, television, and so on.
4. Transmission medium. The transmission medium is the physical path by which a message travels from
sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial cable, fiber-
optic cable, and radio waves.
5. Protocol. A protocol is a set of rules that govern data communications. It represents an agreement
between the communicating devices. Without a protocol, two devices may be connected but not
communicating, just as a person speaking French cannot be understood by a person who speaks only
Japanese.
3 Hardware Components
There are three basic hardware components for a data communications network: • a server (e.g.,
personal computer, mainframe),
• a client (e.g., personal computer, terminal), and
• a circuit (e.g., cable, modem) over which messages flow.
• Both the server and client also need special-purpose network software that enables them to
communicate.
• The server stores data or software that can be accessed by the clients. In client- server computing,
several servers may work together over the network with a client computer to support the business
application.
• The client is the input-output hardware device at the user’s end of a communication circuit. It typically
provides users with access to the network and the data and software on the server.
• The circuit is the pathway through which the messages travel. It is typically a copper wire, although
fiber-optic cable and wireless transmission are becoming common. There are many devices in the circuit
that perform special functions such as switches and routers.

Examples
• Keyboards and traditional monitors are examples of simplex devices.
• Walkie-talkies and CB (citizens band) radios are both half-duplex systems. The half-duplex mode is
used in cases where there is no need for communication in both directions at the same time; the entire
capacity of the channel can be utilized for each direction.
• One common example of full-duplex communication is the telephone network. When two people are
communicating by a telephone line, both can talk and listen at the same time.
Either the link must contain two physically separate transmission paths, one for sending and the other
for receiving; or the capacity of the channel is divided between signals traveling in both directions.

Networks
A network is a set of devices (often referred to as nodes) connected by communication links.
• A node can be a computer, printer, or any other device capable of sending and/or receiving data
generated by other nodes on the network.
• A link can be a cable, air, optical fiber, or any medium which can transport a signal carrying
information.

Network Criteria
•Performance
–Depends on Network Elements
–Measured in terms of Delay and Throughput (how much data can be sent at a time)
•Reliability
–Failure rate of network components
–Measured in terms of availability/robustness
•Security
–Data protection against corruption/loss of data due to:
–Errors
–Malicious users
Physical Structures
Type of Connection
–Point to Point
- single transmitter and receiver
–Multipoint
- multiple recipients of single transmission
•Physical Topology
–Connection of devices
–Type of transmission
- unicast, mulitcast, broadcast

Mesh
•In a mesh topology, every device has a dedicated point-to-point link to every other device.
•The term dedicated means that the link carries traffic only between the two devices it connects.
•In a mesh topology, we need
•n(n -1) /2 duplex-mode links. Nodes are n.

Advantages
1.First, the use of dedicated links guarantees that each connection can carry its own data load, thus
eliminating the traffic problems that can occur when links must be shared by multiple devices.
2.Second, a mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire
system.
3.Third, there is the advantage of privacy or security. When every message travels along a dedicated
line, only the intended recipient sees it. Physical boundaries prevent other users from gaining access to
messages.
4.Finally, point-to-point links make fault identification and fault isolation easy. Traffic can be routed to
avoid links with suspected problems. This facility enables the network manager to discover the precise
location of the fault and aids in finding its cause and solution.

Disadvantages
•First, because every device must be connected to every other device, installation and reconnection are
difficult.
•Second, the sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or floors)
can accommodate.
•Finally, the hardware required to connect each link (I/O ports and cable) can be prohibitively
expensive. For these reasons a mesh topology is usually implemented in a limited fashion, for example,
as a backbone connecting the main computers of a hybrid network that can include several other
topologies. One practical example of a mesh topology is the connection of telephone regional offices in
which each regional office needs to be connected to every other regional office

Star Topology
• In a star topology, each device has a dedicated point-to-point link only to a central controller, usually
called a hub.
• A star topology is less expensive than a mesh topology.
• In a star, each device needs only one link and one I/O port to connect it to any number of others.
• This factor also makes it easy to install and reconfigure.
• Far less cabling needs to be housed, and additions,moves, and deletions involve only one connection:
between that device and the hub.
• Other advantages include robustness. If one link fails, only that link is affected. All other links remain
active.
• This factor also lends itself to easy fault identification and fault isolation.
• One big disadvantage of a star topology is the dependency of the whole topology on one single point,
the hub. If the hub goes down, the whole system is dead.

Bus Topology
A bus topology, is multipoint.
• Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection running
between the device and the main cable.
• A tap is a connector that either splices into the main cable or punctures the sheathing of a cable to
create a contact with the metallic core.
• As a signal travels along the backbone, some of its energy is transformed into heat. Therefore, it
becomes weaker and weaker as it travels farther and farther.
• For this reason there is a limit on the number of taps a bus can support and on the distance between
those taps.

Advantages and Disadvantages


• Advantages of a bus topology include ease of installation. A bus uses less cabling than mesh or star
topologies. In a star, for example, four network devices in the same room require four lengths of cable
reaching all the way to the hub. In a bus, this redundancy is eliminated.

• Disadvantages include difficult reconnection and fault isolation.


• It is difficult to add new devices.
• Signal reflection at the taps can cause degradation in quality • In addition, a fault or break in the bus
cable stops all transmission.
• Bus topology was the one of the first topologies used in the design of early local area networks.
Ethernet LANs can use a bus topology, but they are less popular now.

Ring Topology
•In a ring topology, each device has a dedicated point-to-point connection with only the two devices on
either side of it.
•A signal is passed along the ring in one direction, from device to device, until it reaches its destination.
•Each device in the ring incorporates a repeater. When a device receives a signal intended for another
device, its repeater regenerates the bits and passes them along.

Advantages and Disadvantages


•A ring is relatively easy to install and reconfigure. Each device is linked to only its immediate neighbors.
• To add or delete a device requires changing only two connections.

•In addition, fault isolation is simplified.


• Generally, in a ring, a signal is circulating at all times. If one device does not receive a signal within a
specified period, it can issue an alarm. The alarm alerts the network operator to the problem and its
location.

• However, unidirectional traffic can be a disadvantage. In a simple ring, a break in the ring (such as a
disabled station) can disable the entire network. This weakness can be solved by using a dual ring or a
switch capable of closing off the break.

Applications of Networks
Resource Sharing
- Hardware (Computer resources, disk, printers)
- Software (application software)

Information Sharing
- Easy accessibility from anywhere
- Search Capability

Communication
- Email
- Message Broadcast

Remote Computing

Categories of Networks
Local Area Networks (LANs)
–Short distances
–Designed to provide local interconnectivity
•Metropolitan Area Networks (MANs)
–Provide connectivity over areas such as a city, a campus
•Wide Area Networks (WANs)
–Long distances
–Provide connectivity over large areas like continents

NIC
• NIC stands for network interface card.
• NIC is a hardware component used to connect a computer with another computer onto a network
• It can support a transfer rate of 10,100 to 1000 Mb/s.
• The MAC address or physical address is encoded on the network card chip which is assigned by the
IEEE to identify a network card uniquely. The MAC address is stored in the PROM (Programmable read-
only memory).

Types of NIC
•The Wired NIC is present inside the motherboard. Cables and connectors are used with wired NIC to
transfer data.
•The wireless NIC contains the antenna to obtain the connection over the wireless network. For
example, laptop computer contains the wireless NIC.

The Internet
The Internet (or internet) is the global system of interconnected computer networks that uses the
Internet protocol suite (TCP/IP) to communicate between networks and devices.

ISP
•An Internet service provider (ISP) is an organization that provides services for accessing, using, or
participating in the Internet.
•Internet services typically provided by ISPs can include Internet access, Internet transit, domain name
registration, web hosting, Usenet service, and colocation.
•An ISP typically serves as the access point or the gateway that provides a user, access to everything
available on the Internet.
Chapter 2 – OSI vs. TCP/IP
Why Models?
•A communication subsystem is a complex piece of Hardware and software.
•Early attempts for implementing the software for such subsystems were based on a single, complex,
unstructured program with many interacting components.
•The resultant software was very difficult to test and modify.
•To overcome such problem, the ISO has developed a layered approach.
•In a layered approach, networking concept is divided into several layers, and each layer is assigned a
particular task.
•Therefore, we can say that networking tasks depend upon the layers.

Basic elements
The basic elements of layered architecture are services, protocols, and interfaces.
•Service: It is a set of actions that a layer provides to the higher layer.
•Protocol: It defines a set of rules that a layer uses to exchange the information with peer entity. These
rules mainly concern about both the contents and order of the messages used.
•Interface: It is a way through which the message is transferred from one layer to another layer.

Why do we require Layered architecture?


•Divide-and-conquer approach: Divide-and-conquer approach makes a design process in such a way that
the unmanageable tasks are divided into small and manageable tasks. In short, we can say that this
approach reduces the complexity of the design.
•Modularity: Layered architecture is more modular. Modularity provides the independence of layers,
which is easier to understand and implement.
•Easy to modify: It ensures the independence of layers so that implementation in one layer can be
changed without affecting other layers.
•Easy to test: Each layer of the layered architecture can be analyzed and tested individually.

PROTOCOLS
• A protocol is synonymous with rule. It consists of a set of rules that govern data communications.
• In a layer n architecture, layer n on one machine will have a communication with the layer n on
another machine and the rules used in a conversation are known as a layer-n protocol.
• It determines what is communicated, how it is communicated and when it is communicated.
• The key elements of a protocol are syntax, semantics and timing

Elements of a Protocol
•Syntax
–Structure or format of the data
–Indicates how to read the bits
- field delineation
•Semantics
–Interprets the meaning of the bits
–Knows which fields define what action
•Timing
–When data should be sent and
–What speed at which data should be sent or speed at which it is being received.

The OSI Model


• Established in 1947, the International Standards Organization (ISO) is a multinational body dedicated
to worldwide agreement on international standards.
• An ISO standard that covers all aspects of network communications is the Open Systems
Interconnection (OSI) model.
• It was first introduced in the late 1970s.

OSI Model
•OSI stands for Open System Interconnection is a reference model that describes how information from
a software application in one computer moves through a physical medium to the software application in
another computer.
•OSI consists of seven layers, and each layer performs a particular network function.
•OSI model was developed by the International Organization for Standardization (ISO) in 1984, and it is
now considered as an architectural model for the inter-computer communications.
•OSI model divides the whole task into seven smaller and manageable tasks. Each layer is assigned a
particular task.
•Each layer is self-contained, so that task assigned to each layer can be performed independently

Note: The physical layer is responsible for the movement of individual bits from one hop (node) to the
next.

Functions of a Physical layer:


• Line Configuration: It defines the way how two or more devices can be connected physically.
• Data Transmission: It defines the transmission mode whether it is simplex, half-duplex or fullduplex
mode between the two devices on the network.
• Topology: It defines the way how network devices are arranged.
•Signals: It determines the type of the signal used for transmitting the information.

Note: The data link layer is responsible for moving frames from one hop (node) to the next.

Data Link Layer


• This layer is responsible for the error-free transfer of data frames.
•It defines the format of the data on the network.
•It provides a reliable and efficient communication between two or more devices.
•It is mainly responsible for the unique identification of each device that resides on a local network.
•It contains two sub-layers:
• Logical Link Control Layer
• It is responsible for transferring the packets to the Network layer of the receiver that is
receiving.
• It identifies the address of the network layer protocol from the header.
• It also provides flow control.
• Media Access Control Layer
• A Media access control layer is a link between the Logical Link Control layer and the network's
physical layer.
• It is used for transferring the packets over the network.

Functions of the Data-link layer


•Framing: The data link layer translates the physical's raw bit stream into packets known as Frames.
•The Data link layer adds the header and trailer to the frame.
•The header which is added to the frame contains the hardware destination and source address.

•Physical Addressing: The Data link layer adds a header to the frame that contains a destination address.
The frame is transmitted to the destination address mentioned in the header.
• Flow Control: Flow control is the main functionality of the Data-link layer. It is the technique through
which the constant data rate is maintained on both the sides so that no data get corrupted. It ensures
that the transmitting station such as a server with higher processing speed does not exceed the
receiving station, with lower processing speed.
•Error Control: Error control is achieved by adding a calculated value CRC (Cyclic Redundancy Check)
that is placed to the Data link layer's trailer which is added to the message frame before it is sent to the
physical layer. If any error seems to occur, then the receiver sends the acknowledgment for the
retransmission of the corrupted frames.
• Access Control: When two or more devices are connected to the same communication channel, then
the data link layer protocols are used to determine which device has control over the link at a given
time.

Note: The network layer is responsible for the delivery of individual packets from the source host to the
destination host.

Note: The transport layer is responsible for the delivery of a message from one process to another

TCP/IP protocol suite


The TCP/IP protocol suite is made of five layers: physical, data link, network, transport, and application.
• The first four layers provide physical standards, network interface, internetworking, and transport
functions that correspond to the first four layers of the OSI model.
• The three topmost layers in the OSI model, however, are represented in TCP/IP by a single layer called
the application layer.

Addressing
Three different levels of addresses are used in an internet using the TCP/IP protocols: physical (link)
address, logical (IP) address, and port address.

Comparison and Contrast between the OSI and TCP/IP Model


Last two pages of slides 2
Chapter 2.1 – Internetworking Devices
INTERNETWORKING DEVICES
• Amplifier

• Repeater

• Hub

• Bridge

Switch

• Router

• Brouter

• Gateway

•Repeater-physical layer

•Amplifier – physical layer

•Hub- physical layer

•Bridge-data link

•Switch – data link

•Router- network layer

•Brouter

•Gateway

Repeater
•A repeater operates at the physical layer. Its job is to regenerate the signal over the same network
before the signal becomes too weak or corrupted so as to extend the length to which the signal can be
transmitted over the same network.
•An important point to be noted about repeaters is that they do no amplify the signal.
•When the signal becomes weak, they copy the signal bit by bit and regenerate it at the original
strength.

Amplifier
•An amplifier is also an electronic device, whose purpose is to increase the amplitude of the signal
waveform without altering the other parameters like frequency or wave shape.
•Amplifiers are usually used in wireless communication.
Repeater vs Amplifier
•Repeater and Amplifier both are electronic devices used for enhancing the power of the transmitted
signal.
•The prior difference between them is that repeater is used as a regenerator of the signal which also
eliminates the noise from the signal.
•On the other hand, amplifier just enhances the amplitude of the signal waveform and does not care
about the noise that is being amplified along with the signal.

Network Connectivity Devices


- Repeaters
- Hubs
- Bridges
- Switches

Internetwork Connectivity Devices


- Router
- Gateways

Hub
•A hub is the simplest of these devices. Any data packet coming from one port is sent to all other ports.
That’s the sole purpose of a hub. It is then up to the receiving computer to decide if the packet is for it.
•Imagine packets going through a hub as messages going into a mailing list. The mail is sent out to
everyone and it is up to the receiving party to decide if it is of interest.
•The biggest problem with hubs is their simplicity. Since every packet is sent out to every computer on
the network, there is a lot of wasted transmission. This means that the network can easily become
bogged down.
•Hubs are typically used on small networks where the amount of data going across the network is never
very high.
• Hubs cannot filter data, so data packets are sent to all connected devices.
•In other words, collision domain of all hosts connected through Hub remains one.
•Also, they do not have intelligence to find out best path for data packets which leads to inefficiencies
and wastage.

Bridge
•A bridge goes one step up on a hub in that it reviews the destination of the packet before sending. If
the destination address is not on the other side of the bridge it will not transmit the data.
•A bridge only has one incoming and one outgoing port.
•To build on the email analogy above, the bridge is allowed to decide if the message should continue on.
It reads the address bob@smith.com and decides if there is a bob@smith.com on the other side. If there
isn’t, the message will not be transmitted.
•Bridges are typically used to separate parts of a network that do not need to communicate regularly,
but still need to be connected.
Switch
•A switch steps up on a bridge in that it has multiple ports. When a packet comes through a switch it is
read to determine which computer to send the data to ie. one computer will be the sole receiver of the
package.
• This leads to increased efficiency in that packets are not going to computers that do not require them.
•Switch can perform error checking before forwarding data, that makes it very efficient as it does not
forward packets that have errors and forward good packets selectively to correct port only.
• Now the email analogy has multiple people able to send email to multiple users. The switch can decide
where to send the mail based on the address.
• Most large networks use switches rather than hubs to connect computers within the same subnet.

Routers
– A router is a device like a switch that routes data packets based on their IP addresses. Router is mainly
a Network Layer device.
Routers normally connect LANs and WANs together and have a dynamically updating routing table
based on which they make decisions on routing the data packets.

Brouter
•Brouter in networking is a combination of Bridge and a Router, hence it is called as a Brouter.
•It provides functions of a bridge and a router so it can operate at the data link and network layers of
OSI Model.
•Brouter connects networks which use different protocols.
•It can be programmed to work only as a bridge or only as a router.
•When it is configured as a bridge, it forwards data packets to appropriate segment using a specific
protocol.
•When it is configured as a router, it routes the data packets to the appropriate network using a routed
protocol such as IP.

Gateway
•Gateway – A gateway, as the name suggests, is a passage to connect two networks together that may
work upon different networking models.
•They basically works as the messenger agents that take data from one system, interpret it, and transfer
it to another system.
•Gateways are also called protocol converters and can operate at any network layer.
•Gateways are generally more complex than switch or router.
Chapter 3 – Physical Layer
•This layer is involved in physically carrying information from one node in the network to the next.

• Provide services for the data link layer. The data in the data link layer consists of Os and I s organized
into frames that are ready to be sent across the transmission medium. This stream of Os and I s must
first be converted into another entity: signals.
• Physical characteristics of interfaces and medium: The physical layer defines the characteristics of the
interface between the devices and the transmission medium. It also defines the type of transmission
medium.
• Representation of bits: The physical layer data consists of a stream of bits (sequence of Os or 1s) with
no interpretation. To be transmitted, bits must been coded into signals--electrical or optical. The
physical layer defines the type of encoding (how Os and I s are changed to signals).
• Data rate. The transmission rate-the number of bits sent each second-is also defined by the physical
layer. In other words, the physical layer defines the duration of a bit, which is how long it lasts.
• Synchronization of bits: The sender and receiver not only must use the same bit rate but also must be
synchronized at the bit level. In other words, the sender and the receiver clocks must be synchronized.

•Line configuration: The physical layer is concerned with the connection of devices to the media. In a
point-to-point configuration, two devices are connected through a dedicated link. In a multipoint
configuration, a link is shared among several devices.
•Physical topology: The physical topology defines how devices are connected to make a network.
Devices can be connected by using a mesh topology , a star topology , ring topology , a bus topology, or
a hybrid topology .
•Transmission mode: The physical layer also defines the direction of transmission between two devices:
simplex, half-duplex, or full-duplex.

Transmission Media
• Transmission media are actually located below the physical layer and are directly controlled by the
physical layer.
• A transmission medium can be broadly defined as anything that can carry information from a source to
a destination

Guided Media
•Guided media, are those that provide a conduit from one device to another,
•A signal traveling along any of these media is directed and contained by the physical limits of the
medium.

Twisted-Pair Cable
•A twisted pair consists of two conductors (normally copper), each with its own plastic insulation,
twisted together
•One of the wires is used to carry signals to the receiver, and the other is used only as a ground
reference. The receiver uses the difference between the two.
•In addition to the signal sent by the sender on one of the wires, interference (noise) and crosstalk may
affect both wires and create unwanted signals.
•Twisting makes it probable that both wires are equally affected by external influences (noise or
crosstalk). This means that the receiver, which calculates the difference between the two, receives no
unwanted signals. The unwanted signals are mostly canceled out.

Unshielded Versus Shielded Twisted-Pair Cable


•The most common twisted-pair cable used in communications is referred to as unshielded twisted-pair
(UTP).
•Twisted-pair cables are used in telephone lines to provide voice and data channels.
•IBM has also produced a version of twisted-pair cable for its use called shielded twisted-pair (STP). STP
cable has a metal foil or braided mesh covering that encases each pair of insulated conductors.
• Although metal casing improves the quality of cable by preventing the penetration of noise or
crosstalk, it is bulkier and more expensive.

Coaxial Cable Connectors


•To connect coaxial cable to devices, we need coaxial connectors.
•The most common type of connector used today is the Bayone-Neill-Concelman (BNC), connector.

Fiber optic cables


•A fiber-optic cable, also known as an optical-fiber cable, is an assembly similar to an electrical cable,
but containing one or more optical fibers that are used to carry light.
•The optical fiber elements are typically individually coated with plastic layers and contained in a
protective tube suitable for the environment where the cable will be deployed.
•Different types of cable are used for different applications, for example, long distance
telecommunication, or providing a highspeed data connection between different parts of a building.

Multimode Step-Index
•Multimode is so named because multiple beams from a light source move through the core in different
paths.
•In multimode step-index fiber, the density of the core remains constant from the center to the edges.
•A beam of light moves through this constant density in a straight line until it reaches the interface of
the core and the cladding.
•At the interface, there is an abrupt change due to a lower density; this alters the angle of the beam's
motion.
•The term step index refers to the suddenness of this change, which contributes to the distortion of the
signal as it passes through the fiber.

Multimode Graded-Index
•A second type of fiber, called multimode graded-index fiber, decreases this distortion of the signal
through the cable.
•A graded-index fiber, is one with varying densities. Density is highest at the center of the core and
decreases gradually to its lowest at the edge.

Single Mode
•Single-mode uses step-index fiber and a highly focused source of light that limits beams to a small
range of angles, all close to the horizontal.
•The single mode fiber itself is manufactured with a much smaller diameter than that of multimode
fiber, and with substantially lower density (index of refraction).
• The decrease in density results in a critical angle that is close enough to 90° to make the propagation
of beams almost horizontal.
•In this case, propagation of different beams is almost identical, and delays are negligible.
•All the beams arrive at the destination "together" and can be recombined with little distortion to the
signal

Advantages of fiber optic over copper


• Higher bandwidth. Fiber-optic cable can support dramatically higher bandwidths (and hence data
rates) than either twisted-pair or coaxial cable.
• Less signal attenuation. Fiber-optic transmission distance is significantly greater than that of other
guided media. A signal can run for 50 km without requiring regeneration. We need repeaters every 5 km
for coaxial or twistedpair cable.
• Immunity to electromagnetic interference. Electromagnetic noise cannot affect fiber-optic cables.
• Resistance to corrosive materials. Glass is more resistant to corrosive materials than copper.
• Light weight. Fiber-optic cables are much lighter than copper cables.

Disadvantages
•Installation and maintenance. Fiber-optic cable is a relatively new technology. Its installation and
maintenance require expertise that is not yet available everywhere.
• Unidirectional light propagation. Propagation of light is unidirectional. If we need bidirectional
communication, two fibers are needed.
• Cost. The cable and the interfaces are relatively more expensive than those of other guided media. If
the demand for bandwidth is not high, often the use of optical fiber cannot be justified.

Wireless media
•Wireless media include radio frequencies, microwave, satellite, and infrared.
•Deployment of wireless media is faster and less costly than the deployment of cable, mostly where
there is no existing infrastructure.
•There are a few disadvantages associated with wireless. It supports much lower data rates than do
wired media.
•Wireless is also greatly affected by external environments, such as the impact of weather, as a result,
reliability can be difficult to guarantee.
•It carries data in the form of electromagnetic signals using radio or microwave frequencies.
•Wireless media provides the best mobility options, and the number of wireless-enabled devices
continues to increase

Electromagnetic spectrum
•The electromagnetic spectrum is the range of frequencies (the spectrum) of electromagnetic radiation
and their respective wavelengths.
•Some specific frequencies are used to transmit signals over the air, but as a rule, remember that: “ The
higher the frequency, the faster the transmission, and the lower the tolerance to solid obstacles.”
Radio Waves
• Electromagnetic waves ranging in frequencies between 3 kHz and 300 GHz are normally called radio
waves
• Radio waves, for the most part, are omnidirectional. When an antenna transmits radio waves, they are
propagated in all directions.
• This means that the sending and receiving antennas do not have to be aligned. A sending antenna
sends waves that can be received by any receiving antenna. The omnidirectional property has a
disadvantage, too. The radio waves transmitted by one antenna are susceptible to interference by
another antenna that may send signals using the same frequency or band.
• Radio waves, particularly those of low and medium frequencies, can penetrate walls. The
omnidirectional characteristics of radio waves make them useful for multicasting, in which there is one
sender but many receivers. AM and FM radio are examples

Microwaves
•Electromagnetic waves having frequencies between 1 and 300 GHz are called microwaves.
•Microwaves are unidirectional. When an antenna transmits microwaves, they can be narrowly focused.
This means that the sending and receiving antennas need to be aligned.
•The unidirectional property has an obvious advantage. A pair of antennas can be aligned without
interfering with another pair of aligned antennas.

Characteristics of microwave propagation


•Microwave propagation is line-of-sight. Since the towers with the mounted antennas need to be in
direct sight of each other, towers should be far apart and need to be very tall.
•Very high-frequency microwaves cannot penetrate walls. This characteristic can be a disadvantage if
receivers are inside buildings.
•The microwave band is relatively wide, almost 299 GHz. Therefore wider sub bands can be assigned,
and a high data rate is possible
•Use of certain portions of the band requires permission from authorities.

Applications
•Microwaves, due to their unidirectional properties, are very useful when unicast (one-to-one)
communication is needed between the sender and the receiver.
•They are used in cellular phones , satellite networks , and wireless LANs

Infrared waves
• Infrared waves, with frequencies from 300 GHz to 400 THz, can be used for short-range
communication.
• Infrared waves, having high frequencies, cannot penetrate walls. This advantageous characteristic
prevents interference between one system and another; a short-range communication system in one
room cannot be affected by another system in the next room.
• When we use our infrared remote control, we do not interfere with the use of the remote by our
neighbors. However, this same characteristic makes infrared signals useless for long-range
communication.
• In addition, we cannot use infrared waves outside a building because the sun's rays contain infrared
waves that can interfere with the communication.
• In ground propagation, radio waves travel through the lowest portion of the atmosphere, hugging the
earth.
• These low-frequency signals emanate in all directions from the transmitting antenna and follow the
curvature of the planet.
• Distance depends on the amount of power in the signal: The greater the power, the greater the
distance.
• In sky propagation, higher-frequency radio waves radiate upward into the ionosphere (the layer of
atmosphere where particles exist as ions) where they are reflected back to earth. This type of
transmission allows for greater distances with lower output power.
• In line-or-sight propagation, very high-frequency signals are transmitted in straight lines directly from
antenna to antenna.
• Antennas must be directional, facing each other, and either tall enough or close enough together not
to be affected by the curvature of the earth. Line-of sight propagation is tricky because radio
transmissions cannot be completely focused.

Unidirectional Antenna
• Microwaves need unidirectional antennas that send out signals in one direction.
• Two types of antennas are used for microwave communications: the parabolic dish and the horn
antenna.
•A parabolic dish antenna is based on the geometry of a parabola: Every line parallel to the line of
symmetry (line of sight) reflects off the curve at angles such that all the lines intersect in a common
point called the focus. The parabolic dish works as a funnel, catching a wide range of waves and
directing them to a common point.
•In this way, more of the signal is recovered than would be possible with a single-point receiver.

•Outgoing transmissions are broadcast through a horn aimed at the dish.


•The microwaves hit the dish and are deflected outward in a reversal of the receipt path.
•A horn antenna looks like a gigantic scoop. Outgoing transmissions are broadcast up a stem
(resembling a handle) and deflected outward in a series of narrow parallel beams by the curved head.
•Received transmissions are collected by the scooped shape of the horn, in a manner similar to the
parabolic dish, and are deflected down into the stem.
Chapter 4 – Data Link Layer

•Layer 2 of the OSI model


•Reliable, efficient communication between two adjacent machines. Node to node communication.
•The two main functions of the data link layer are Logical link control (LLC)and media access control
(MAC)

Data Link Layer Services


1. Services provided to the network layer
2. 2. Framing
3. 3. Error control
4. 4. Flow control

Framing
•The data link layer, needs to pack bits into frames, so that each frame is distinguishable from another.
•Encapsulate datagram into frame, adding header and trailer
•Framing in the data link layer separates a message from one source to a destination, or from other
messages to other destinations, by adding a sender address and a destination address. •Compute the
checksum of each frame
•Variable-size framing is prevalent in local area networks. In variable-size framing, we need a way to
define the end of the frame and the beginning of the next.
•Two approaches were used for this purpose: a character oriented approach and a bit-oriented
approach

Framing methods:
–Character count
–Starting and ending characters, with character stuffing
–Starting and ending flags with bit stuffing
–Physical layer coding violations

Character Count
This method uses a field in the header to specify the number of characters in the frame.
•When the data link layer at the destination sees the character count, it knows how many characters
follow, and hence where the end of the frame is.
•The disadvantage is that if the count is garbled by a transmission error, the destination will lose
synchronization and will be unable to locate the start of the next frame.
•So, this method is rarely used.

Character Stuffing
•In character stuffing, a special character is added to the data section of the frame when there is a
character with the same pattern as the flag.
•The data section is stuffed with an extra byte. This byte is usually called the escape character (ESC),
which has a predefined bit pattern.
•Whenever the receiver encounters the ESC character, it removes it from the data section and treats the
next character as data, not a delimiting flag.

Character Stuffing - problem


•Character stuffing by the escape character allows the presence of the flag in the data section of the
frame, but it creates another problem.
• What happens if the text contains one or more escape characters followed by a flag? The receiver
removes the escape character, but keeps the flag, which is incorrectly interpreted as the end of the
frame.
•To solve this problem, the escape characters that are part of the text must also be marked by another
escape character.

•In other words, if the escape character is part of the text, an extra one is added to show that the
second one is part of the text.

•Character-oriented protocols present another problem in data communications.

•The universal coding systems in use today, such as Unicode, have 16-bit and 32-bit characters that
conflict with 8-bit characters. We can say that in general, the tendency is moving toward the bit-
oriented protocols that we discuss next.

Bit-Oriented Protocols
•Bit-oriented protocols transmit information without regard to character boundaries and thus handle all
types of information .
•They are much less overhead-intensive, as compared to byteoriented protocols, also known as
character-oriented protocols.
•In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted by the
upper layer as text, graphic, audio, video, and so on.
•However, in addition to headers (and possible trailers), we still need a delimiter to separate one frame
from the other.
•Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning and
the end of the frame.

This flag can create the same type of problem we saw in the byte-oriented protocols.
•That is, if the flag pattern appears in the data, we need to somehow inform the receiver that this is not
the end of the frame. We do this by stuffing 1 single bit (instead of I byte) to prevent the pattern from
looking like a flag.
•The strategy is called bit stuffing. In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an
extra 0 is added.
•This extra stuffed bit is eventually removed from the data by the receiver. Note that the extra bit is
added after one 0 followed by five 1s regardless of the value of the next bit.
• This guarantees that the flag field sequence does not inadvertently appear in the frame.
Physical Layer Coding Violations
•Encoding violation is method that is used only for network in which encoding on physical medium
includes some sort of redundancy i.e., use of more than one graphical or visual structure to simply
encode or represent one variable of data.
• For example, some LANs encode 1 bit of data by using 2 physical bits.
•Normally, a 1 bit is a high-low pair and a 0 bit is a low-high pair.
• 11 or 00 are not used for data but are used for delimiting frames in some protocols.
– Use special symbol (that never occur in the data) for the frame boundary.
– E.g: Manchester code 1: low to high, 0: high to low. Frame boundary symbol: high-high or low-
low.

ENQ/ACK - Enquiry/Acknowledgement
•ENQ/ACK is a procedure of line discipline that is generally used to determine that which of device on
network is capable of initiating or starting transmission of data or message and whether the receiver is
ready and is capable to receive the data or not.

Poll/Select
•The Poll/Select method in line discipline basically works with some topologies where one of devices is
considered as primary station and other devices are considered as secondary stations.
•When primary station wants to transmit something to secondary station i.e. downstream, then Select
mode is used.
•To solicit (ask for obtaining) transmission from secondary to primary i.e. upstream, then Poll mode is
used.
•The primary device basically controls and handles link or connection and on the other hand, secondary
device simply follows its instructions.

Flow Control
• Flow control coordinates the amount of data that can be sent before receiving an acknowledgment.
• The flow of data must not be allowed to overwhelm the receiver.
•Any receiving device has a limited speed at which it can process incoming data and a limited amount of
memory in which to store incoming data.
• The receiving device must be able to inform the sending device before those limits are reached and to
request that the transmitting device send fewer frames or stop temporarily.
• Incoming data must be checked and processed before they can be used. The rate of such processing is
often slower than the rate of transmission.
• For this reason, each receiving device has a block of memory, called a buffer, reserved for storing
incoming data until they are processed.
•If the buffer begins to fill up, the receiver must be able to tell the sender to halt transmission until it is
once again able to receive.

Stop and Wait


•Here stop and wait means, whatever the data that sender wants to send, he sends the data to the
receiver.
•After sending the data, he stops and waits until he receives the acknowledgment from the receiver.
Stop and Wait ARQ
If sender receives a positive acknowledgement (ACK) it transmits the next frame.
•If it receives a negative acknowledgement (NAK) it retransmits the same frame.
•The retransmission of the frame is essential under the following events:
–If the received frame is damaged
–If the transmitted frame is lost
–If the acknowledgement from the receiver is lost

Disadvantages of Stop and Wait


The Stop and Wait may cause big performance issues as sender always waits for acknowledgement even
if it has next packet ready to send.
•Consider a situation where you have a high bandwidth connection and propagation delay is also high
(you are connected to some server in some other country though a high speed connection), you can’t
use this full speed due to limitations of stop and wait.
•Sliding Window protocol handles this efficiency issue by sending more than one packet at a time with a
larger sequence numbers. The idea is same as pipelining in architectures.

Sliding Window Protocol


•In this protocol, multiple frames can be sent by a sender at a time before receiving an acknowledgment
from the receiver. The term sliding window refers to the imaginary boxes to hold frames.
• This window holds the frames at the transmitting as well as receiving ends and provides the upper
limit on the number of frames that can be transmitted before an acknowledgement is obtained.
• The range which is the concern of the sender is called the send sliding window, the range that is the
concern of the receiver is called the receive sliding window.
• One of the important features of all the sliding window protocols is that each outbound frame
contains a sequence number, ranging from 0 to some maximum value. The maximum value is generally
equal to (2 raised to ‘n’ – 1). Where ‘n’ is an arbitrary number.

•A send window can slide one or more slots to the right when an acknowledgment arrives from the
other end and the receive window makes sure that the correct data frames are then received and the
correct acknowledgments are sent.

Difference
•The basic difference between go-back-n protocol and selective repeat protocol is that the “go-back-n
protocol” retransmits all the frames that lie after the frame which is damaged or lost.
•The “selective repeat protocol” retransmits only that frame which is damaged or lost.
•For a receiver using selective repeat, the sliding window is the group of frames that its receiving buffer
maps to. A receiver using Go-back-N does not have a buffer and thus does not have a concept of
window.

Error control
•Error control is both error detection and error correction. It allows the receiver to inform the sender of
any frames lost or damaged in transmission and coordinates the retransmission of those frames by the
sender.
•Error control in the data link layer is often implemented simply: Any time an error is detected in an
exchange, specified frames are retransmitted. This process is called automatic repeat request (ARQ).

What is Error?
•Error – Garbled frame
•Error – Lost frame
•Error – Duplicate frame

Error Control
•Error Detection:
–errors caused by signal attenuation, noise.
–receiver detects presence of errors:
•error-detection codes
•signals sender for retransmission or drops frame
•Error Correction:
–receiver identifies and corrects bit error(s) without resorting to retransmission
•error-correction codes

Note: To detect or correct errors, we need to send extra (redundant) bits with data.

Block Coding
In block coding, we divide our message into blocks, each of k bits, called datawords. We add r redundant
bits to each block to make the length n = k + r. The resulting n-bit blocks are called codewords.
Error Detection
•Enough redundancy is added to detect an error.
•The receiver knows an error occurred but does not know which bit(s) is(are) in error. •Has less
overhead than error correction.
•Some popular techniques for error detection are: 1. Simple Parity check 2. Two-dimensional Parity
check 3. Checksum 4. Cyclic redundancy check
Checksum
In checksum error detection scheme, the data is divided into k segments each of m bits.
•In the sender’s end the segments are added using 1’s complement arithmetic to get the sum. The sum
is complemented to get the checksum.
•The checksum segment is sent along with the data segments.
•At the receiver’s end, all received segments are added using 1’s complement arithmetic to get the sum.
The sum is complemented.
•If the result is zero, the received data is accepted; otherwise discarded.

Example
• Suppose that the sender wants to send 4 frames each of 8 bits, where the frames are 11001100,
10101010, 11110000 and 11000011.
• The sender adds the bits using 1s complement arithmetic. While adding two numbers using 1s
complement arithmetic, if there is a carry over, it is added to the sum.
• After adding all the 4 frames, the sender complements the sum to get the checksum, 11010011, and
sends it along with the data frames.
• The receiver performs 1s complement arithmetic sum of all the frames including the checksum. The
result is complemented and found to be 0. Hence, the receiver assumes that no error has occurred.

Example
Let us calculate the checksum for a text of 8 characters (“Forouzan”). The text needs to be divided into
2-byte (16-bit) words. We use ASCII to change each byte to a 2-digit hexadecimal number.
• For example, F is represented as 0x46 and o is represented as 0x6F. Figure 3 shows how the checksum
is calculated at the sender and receiver sites.
• In part a of the figure, the value of partial sum for the first column is 0x36.
• We keep the rightmost digit (6) and insert the leftmost digit (3) as the carry in the second column.
• The process is repeated for each column.
• Note that if there is any corruption, the checksum recalculated by the receiver is not all 0s. We leave
this an exercise.

Cyclic redundancy check (CRC)


•Unlike checksum scheme, which is based on addition, CRC is based on binary division.
•In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of
data unit so that the resulting data unit becomes exactly divisible by a second, predetermined binary
number.
•At the destination, the incoming data unit is divided by the same number. If at this step there is no
remainder, the data unit is assumed to be correct and is therefore accepted.
•A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.

CRC Generator
•CRC generator is an algebraic polynomial represented as a bit pattern.
•Bit pattern is obtained from the CRC generator using the following rule-
•The power of each term gives the position of the bit and the coefficient gives the value of the bit.

Properties Of CRC Generator


The algebraic polynomial chosen as a CRC generator should have at least the following properties
Rule-01: It should not be divisible by x. This condition guarantees that all the burst errors of length equal
to the length of polynomial are detected.
Rule-02: It should be divisible by x+1. This condition guarantees that all the burst errors affecting an odd
number of bits are detected

If the CRC generator is chosen according to the above rules, then-


•CRC can detect all single-bit errors
•CRC can detect all double-bit errors provided the divisor contains at least three logic 1’s.
•CRC can detect any odd number of errors provided the divisor is a factor of x+1.
•CRC can detect all burst error of length less than the degree of the polynomial.
•CRC can detect most of the larger burst errors with a high probability.

Problem-02:
•A bit stream 10011101 is transmitted using the standard CRC method. The generator polynomial is
x3+1.
• What is the actual bit string transmitted?

•Solution-
•Part-01:
• The generator polynomial G(x) = x3 + 1 is encoded as 1001.
• Clearly, the generator polynomial consists of 4 bits. • So, a string of 3 zeroes is appended to
the bit stream to be transmitted.
• The resulting bit stream is 10011101000.
•Now, the binary division is performed as-

Problem 03
• A bit stream 1101011011 is transmitted using the standard CRC method. The generator
polynomial is x4+x+1. What is the actual bit string transmitted?

• Solution-
• The generator polynomial G(x) = x4 + x + 1 is encoded as 10011.
• Clearly, the generator polynomial consists of 5 bits. • So, a string of 4 zeroes is appended to
the bit stream to be transmitted.
• The resulting bit stream is 11010110110000. • Now, the binary division is performed as-
Error Correction
Error correction can be done in two ways:
•Backward Error Correction: When the receiver detects an error in the data received, it requests back
the sender to retransmit the data unit.
•Forward Error Correction: When the receiver detects some error in the data received, it uses an error-
correcting code, which helps it to auto-recover and correct some kinds of errors.
Hamming Distance

Minimum Hamming Distance

Note: To guarantee the detection of up to s errors in all cases, the minimum Hamming distance in a
block code must be dmin = s + 1.
Error Detection
Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider the following
cases:
1. The receiver receives 011. It is a valid codeword. The receiver extracts the dataword 01 from it.
2. The codeword is corrupted during transmission, and 111 is received. This is not a valid codeword and
is discarded.
3. The codeword is corrupted during transmission, and 000 is received. This is a valid codeword. The
receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable

Error Correction
Let us add more redundant bits to see if the receiver can correct an error without knowing what was
actually sent.
• We add 3 redundant bits to the 2-bit dataword to make 5-bit codewords. Table 2 shows the datawords
and codewords. Assume the dataword is 01.
• The sender creates the codeword 01011. The codeword is corrupted during transmission, and 01001 is
received.
• First, the receiver finds that the received codeword is not in the table. This means an error has
occurred. The receiver, assuming that there is only 1 bit corrupted, uses the following strategy to guess
the correct dataword.
Error Correction
1.Comparing the received codeword with the first codeword in the table (01001 versus 00000), the
receiver decides that the first codeword is not the one that was sent because there are two different
bits.
2. By the same reasoning, the original codeword cannot be the third or fourth one in the table.
3. The original codeword must be the second one in the table because this is the only one that differs
from the received codeword by 1 bit. The receiver replaces 01001 with 01011 and consults the table to
find the dataword 01.

Note: To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block
code must be dmin = 2t + 1.

Example
A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability
of this scheme?
Solution
This code guarantees the detection of up to three errors (s = 3), but it can correct up to one error.
dmin=s+1
4=s+1 ;
s=4-1=3
dmin=2t+1
4=2t+1 ;
3/2=t ;
t=1
IEEE 802.3 Ethernet
•Ethernet is a family of wired computer networking technologies commonly used in local area networks
(LAN).
• It was commercially introduced in 1980 and first standardized in 1983 as IEEE 802.3.
•Ethernet has since been refined to support higher bit rates, a greater number of nodes, and longer link
distances, but retains much backward compatibility.
•Over time, Ethernet has largely replaced competing wired LAN technologies such as Token Ring and
FDDI I

Frame Format
Basic frame format which is required for all MAC implementation is defined in IEEE 802.3 standard.
•PREAMBLE – Ethernet frame starts with 7-Bytes Preamble. This is a pattern of alternative 0’s and 1’s
which indicates starting of the frame and allow sender and r eceiver to establish bit synchronization.
•Start of frame delimiter (SFD) – This is a 1-Byte field which is always set to 10101011. SFD indicates that
upcoming bits are starting of the frame, which is the destination address.

• Destination Address – This is 6-Byte field which contains the MAC address of machine for which data is
destined.
•Source Address – This is a 6-Byte field which contains the MAC address of source machine. As Source
Address is always an individual address (Unicast), the least significant bit of first byte is always 0.
• Length – Length is a 2-Byte field, which indicates the length of entire Ethernet frame.
• Data – This is the place where actual data is inserted, also known as Payload. Both IP header and data
will be inserted here if Internet Protocol is used over Ethernet. The maximum data present may be as
long as 1500 Bytes. In case data length is less than minimum length i.e. 46 bytes, then padding 0’s is
added to meet the minimum possible length.
• Cyclic Redundancy Check (CRC) – CRC is 4 Byte field. This field contains a 32-bits hash code of data,
which is generated over the Destination Address, Source Address, Length, and Data field.
Chapter 6 – Network Layer
The Network Layer is the third layer of the OSI model.
•It handles the service requests from the transport layer and further forwards the service request to the
data link layer.
•The network layer translates the logical addresses into physical addresses
•It determines the route from the source to the destination and also manages the traffic problems such
as switching, routing and controls the congestion of data packets.
•The main role of the network layer is to move the packets from sending host to the receiving host.

Functions performed by the network layer


• Routing: When a packet reaches the router's input link, the router will move the packets to the
router's output link.
• Logical Addressing: The data link layer implements the physical addressing and network layer
implements the logical addressing. Logical addressing is also used to distinguish between source and
destination system. The network layer adds a header to the packet which includes the logical addresses
of both the sender and the receiver.
•Internetworking: This is the main role of the network layer that it provides the logical connection
between different types of networks.
• Fragmentation: The fragmentation is a process of breaking the packets into the smallest individual
data units that travel through different networks.

Host to host delivery


•The network layer is responsible for host-to-host delivery and for routing the packets through the
routers.
•In circuit switching, the whole message is sent from the source to the destination without being divided
into packets.
•In packet switching, the message is first divided into manageable packets at the source before being
transmitted. The packets are assembled at the destination
•The network layer is designed as a packet-switched network

Circuit Switching
•Dedicated communication path between two stations
•Three phases
–Establish
–Transfer
–Disconnect
•Must have switching capacity and channel capacity to establish connection
•Must have intelligence to work out routing

Circuit Switching - Disadvantages


•Inefficient
–Channel capacity dedicated for duration of connection
–If no data, capacity wasted
•Set up (connection) takes time
•Once connected, transfer is transparent
•Developed for voice traffic (phone)

Packet Switching: Basic Operation


•Data transmitted in small packets
–Longer messages split into series of packets
–Each packet contains a portion of user data plus some control info
•Control info
–Routing (addressing) info
•Packets are received, stored briefly (buffered) and passed on to the next node
–Store and forward

Packet Switching-Advantages
•Line efficiency
–Single node to node link can be shared by many packets over time
–Packets queued and transmitted as fast as possible
•Data rate conversion
–Each station connects to the local node at its own speed
–Nodes buffer data if required to equalize rates
•Packets are accepted even when network is busy

Switching Technique
•Station breaks long message into packets
•Packets sent one at a time to the network
•Packets handled in two ways
–Datagram
–Virtual circuit

Datagram
•Each packet treated independently
•Packets can take any practical route
•Packets may arrive out of order
•Packets may go missing
•Up to receiver to re-order packets and recover from missing packets
Chapter 6.1 – Network Routing
Routing

• When a device has multiple paths to reach a destination, it always selects one path by preferring it
over others. This selection process is termed as Routing. Routing is done by special network devices
called routers
•In case there are multiple path existing to reach the same destination, router can make decision based
on the following information:
•Hop Count
•Bandwidth
•Metric
•Prefix-length
•Delay
• Routes can be statically configured or dynamically learnt. One route can be configured to be preferred
over others.

Static Routing(Non Adaptive)


•Static Routing is also known as Nonadaptive Routing.
•It is a technique in which the administrator manually adds the routes in a routing table.
•A Router can send the packets for the destination along the route defined by the administrator.
•In this technique, routing decisions are not made based on the condition or topology of the networks

Advantages Of Static Routing


•No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper router can be
used to obtain static routing.
•Bandwidth: It has not bandwidth usage between the routers.
•Security: It provides security as the system administrator is allowed only to have control over the
routing to a particular network.

•Disadvantages of Static Routing:


•For a large network, it becomes a very difficult task to add each route manually to the routing table.
•The system administrator should have a good knowledge of a topology as he has to add each route
manually.

Default Routing
•Default Routing is a technique in which a router is configured to send all the packets to the same hop
device, and it doesn't matter whether it belongs to a particular network or not. A Packet is transmitted
to the device for which it is configured in default routing.
•Default Routing is used when networks deal with the single exit point.
•It is also useful when the bulk of transmission networks have to transmit the data to the same device.
•When a specific route is mentioned in the routing table, the router will choose the specific route rather
than the default route. The default route is chosen only when a specific route is not mentioned in the
routing table.
Dynamic Routing(Adaptive)
•It is also known as Adaptive Routing.
•It is a technique in which a router adds a new route in the routing table for each packet in response to
the changes in the condition or topology of the network.
•Dynamic protocols are used to discover the new routes to reach the destination.
•In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
•If any route goes down, then the automatic adjustment will be made to reach the destination.

The Dynamic protocol should have the following features:


•All the routers must have the same dynamic routing protocol in order to exchange the routes.
•If the router discovers any change in the condition or topology, then router broadcast this information
to all other routers.

Advantages of Dynamic Routing:


•It is easier to configure.
•It is more effective in selecting the best route in response to the changes in the condition or topology.
Disadvantages of Dynamic Routing:
•It is more expensive in terms of CPU and bandwidth usage.
•It is less secure as compared to default and static routing.

What is a router?
•A router is a piece of network hardware responsible for forwarding packets to their destinations.
•Routers connect to two or more IP networks or subnetworks and pass data packets between them as
needed.
•Routers are used in homes and offices for setting up local network connections.
•More powerful routers operate all over the Internet, helping data packets reach their destinations.

How routers work?


•When a router receives a packet, it reads the headers of the packet to see its intended destination, like
the way a train conductor may check a passenger's tickets to determine which train they should go on.
•It then determines where to route the packet based on information in its routing tables.
•Routers do this millions of times a second with millions of packets.
•As a packet travels to its destination, it may be routed several times by different routers.

Flooding(Static)
•In case of flooding, every incoming packet is sent to all the outgoing links except the one from it has
been reached. The disadvantage of flooding is that node may contain several copies of a particular
packet.

Advantages
1) In military applications, where large numbers of routers are blown, flooding is desirable.
2) In Distributed database applications, it is some times necessary to update all the databases
concurrently, in which flooding is useful.
3) It is used as a metric against which other routing algorithms are compared.
4) Flooding chooses the shortest path, because it chooses all possible path in parallel.
Distance Vector Routing
•Distance vector means that routes are advertised by providing two characteristics:
•Distance - Identifies how far it is to the destination network and is based on a metric such as the hop
count, cost, bandwidth, delay, and more.
•Vector - Specifies the direction of the next-hop router or exit interface to reach the destination.

DVR-Believe in neighbour’s gossip


•It is a dynamic routing algorithm in which each router computes distance between itself and each
possible destination i.e. its immediate neighbors.
•The router share its knowledge about the whole network to its neighbors and accordingly updates
table based on its neighbors.
•The sharing of information with the neighbors takes place at regular intervals.
•It makes use of Bellman Ford Algorithm for making routing tables.
•Problems – Count to infinity problem which can be solved by splitting horizon.
•– Good news spreads fast and bad news spreads slowly.

Because each router depends on its neighbours for information, which the neighbours in turn may have
learned from their neighbours, and so on, distance vector routing is sometimes facetiously referred to as
"routing by rumour.“ Believing in neighbour's gossip.

Link State Routing


•It is a dynamic routing algorithm in which each router shares knowledge of its neighbors with every
other router in the network.
•A router sends its information about its neighbors only to all the routers through flooding.
•Information sharing takes place only whenever there is a change.
•It makes use of Dijkastra’s Algorithm for making routing tables.
•Problems – Heavy traffic due to flooding of packets.
What is an autonomous system?
•The Internet is a network of networks; it’s broken up into hundreds of thousands of smaller networks
known as autonomous systems (AS).
•Each of these networks is essentially a large pool of routers run by a single organization.

EIGRP
•Enhanced Interior Gateway Routing Protocol (EIGRP) is an advanced distance-vector routing protocol
that is used on a computer network for automating routing decisions and configuration. The protocol
was designed by Cisco Systems as a proprietary protocol, available only on Cisco routers.
•EIGRP replaced the Interior Gateway Routing Protocol (IGRP) in 1993. One of the major reasons for this
was the change to classless IPv4 addresses in the Internet Protocol, which IGRP could not support.

BGP
•Border Gateway Protocol (BGP) is a standardized exterior gateway protocol designed to exchange
routing and reachability information among autonomous systems (AS) on the Internet.
•BGP is classified as a path-vector routing protocol

IS-IS
•The IS-IS (Intermediate System - Intermediate System) protocol is one of a family of IP Routing
protocols, and is an Interior Gateway Protocol (IGP) for the Internet, used to distribute IP routing
information throughout a single Autonomous System (AS) in an IP network.
•IS-IS is a link-state routing protocol, operating by reliably flooding link state information throughout a
network of routers.

OSPF
•Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks.
•It uses a link state routing (LSR) algorithm and falls into the group of interior gateway protocols (IGPs),
operating within a single autonomous system (AS)
•It implements Dijkstra's algorithm, also known as the shortest path first (SPF) algorithm
Chapter 6.2 – Network Protocols
Internet Network Layer Protocols
IPv4 Address
•An IPv4 address is 32 bits long. unique and universal. Address space of IPv4 is 232 or 4,294,967,296.
ARP – Address Resolution Protocol
•Most of the computer programs/applications use logical address (IP address) to send/receive
messages, however the actual communication happens over the physical address (MAC address) i.e
from layer 2 of OSI model.
•So our mission is to get the destination MAC address which helps in communicating with other devices.
This is where ARP comes into the picture, its functionality is to translate IP address to physical address.
RARP

ICMP – Internet Control Message Protocol

ICMP
The IP protocol has no error-reporting or error-correcting mechanism.
• What happens if something goes wrong?
• What happens if a router must discard a datagram because it cannot find a router to the final
destination, or because the time-to-live field has a zero value?
• What happens if the final destination host must discard all fragments of a datagram because it has not
received all fragments within a predetermined time limit?
• The IP protocol also lacks a mechanism for host and management queries. A host sometimes needs to
determine if a router or another host is alive. And sometimes a network manager needs information
from another host or router.
• The Internet Control Message Protocol (ICMP) has been designed to compensate for the above two
deficiencies. It is a companion to the IP protocol
ICMP Error Message and Query Message
IGMP
•IGMP is a group management protocol.
•It helps a multicast router create and update a list of loyal members related to each router interface.
•It allows the network to direct multicast transmissions only to hosts that have requested them.
•IGMP can be used for one-to-many networking applications such as online streaming video and
gaming, and allows more efficient use of resources when supporting these types of applications.

BOOTP

Dynamic Host Configuration Protocol (DHCP)


•The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet
Protocol (IP) networks, whereby a DHCP server dynamically assigns an IP address and other network
configuration parameters to each device on the network, so they can communicate with other IP
networks.
•A DHCP server enables computers to request IP addresses and networking parameters automatically
from the Internet service provider (ISP), reducing the need for a network administrator or a user to
manually assign IP addresses to all network devices.

BOOTP VS DHCP
•The BOOTP and DHCP protocols are used for obtaining the IP address of the host along with the
bootstrap information.
•The working of both protocols is different in some manner. DHCP protocol is the extended version of
the BOOTP protocol.
•The major difference between BOOTP and DHCP is that BOOTP support static configuration of the IP
addresses while DHCP supports dynamic configuration.
•BOOTP does not provide temporary IP addressing. While DHCP provides temporary IP addressing for
only limited amount of time.
Chapter 6.3 – Network Addressing
Network address translation (NAT).
•The technology allows a site to use a set of private addresses for internal communication and a set of
global Internet addresses(at least one) for communication with the rest of the world.
•The site must have only one single connection to the global Internet through a NAT-capable router that
runs NAT software.

Address Translation
•All of the outgoing packets go through the NAT router, which replaces the source address in the packet
with the global NAT address.
•All incoming packets also pass through the NAT router, which replaces the destination address in the
packet (the NAT router global address) with the appropriate private address.

Subnet Mask
•The network mask is used when a network is not subnetted.
•When we divide a network to several subnetworks, we need to create a subnetwork mask (or subnet
mask) for each subnetwork. A subnetwork has subnetid and hosted

Classful addressing-Problems
•Millions of class A addresses are wasted.
•Many class B addresses are wasted.
•Not many organizations are so small to have a class C block.
•Class D addresses are used for multicasting
•class E addresses was reserved for future purposes.

Classless Inter-Domain Routing (CIDR)


•Classless Inter-Domain Routing was introduced in 1993 to replace the classful network design.
•Instead of allocating network addresses using address classes based on 8 bit groups it uses variable
length subnet masking. It also introduced a new method of denoting network masks.

•Example: A class C network would have a subnet mask of 255.255.255.0 which means that 24 bits are
used for the network.
•In CIDR notation this is designated by a /24 following the IP address. So:
•IP address 192.168.1.168 subnet mask 255.255.255.0 is written as: 192.168.1.168/24 in CIDR notation.

•128 64 32 16 8 4 2 1
•11111111
•In binary, 255 is 11111111, and 0 is 0. So a subnet mask of 255.255.255.0 would be converted to:
• 11111111.11111111.11111111.0000000
•When you match this with an IP address, such as 192.168.123.132, you can determine the network
portion and the host portion of the IP address.

•Each “1” in the subnet mask exists for the bit portions of the IP address allocated to the network, and
each “0” exists for when a bit portion is allocated to the host. Here is an example:
•11111111.11111111.11111111.0000000 (subnet mask)
•11000000.10101000.01111011.10000100 (IP address 192.168.123.132 in binary)
•This means the network portion of the subnet is 192.168.123, and the .132 is allocated to the host.
•When information arrives on the 192.168.123.0 network, it’ll be processed as part of the network and
then delivered to the 0.0.0.132 host.

Subnetting
•Subnetting allows you to create smaller network (sub networks; subnets) inside a large network by
borrowing bits from the Host ID portion of the address.
•We can use those borrowed bits to create additional networks, resulting in smaller-sized networks.
•Imagine I want to build a network that will support up to 30 devices in different segments. Without
subnetting, I will need four (4) Class C networks to support this design.

For example:
•Network #1: 192.168.1.0
•Network #2: 192.168.2.0
•Network #3: 192.168.3.0
•Network #4: 192.168.4.0
•Each of these networks will support 254 IP addresses leading to a wastage of (254 * 4) – (30 * 4) IP
addresses i.e. 896 IP addresses!
•If you look at the design requirement of 30 hosts per network, you will discover that I only need 5 bits
in the host ID portion of a Class C network to satisfy my requirement.
•128 64 32 16 8 4 2 1
• 0 0 0 1 1 1 1 1 = 31

•This means I still have 3 bits unused and with subnetting, I can use those three bits to create smaller
networks. For this example, let’s take the 192.168.1.0 network:
Subnetting
•With subnetting, not only have we used only one Class C network, we have created 8 subnets from that
network, each one supporting up to 30 hosts!
•We can use 4 of these subnets for our network and reserve the remaining 4 subnets for future
expansion.
• This results in great waste reduction – from 896 wasted IP addresses to 120 reserved IP addresses.

Advantages of Subnetting

Slash Notation
•It’s a compact representation of Subnet mask. In this notation a slash (/) sign and total number of the
on bits in subnet mask are written with IP address instead of full Subnet mask.

Possible Number of Subnets


•To calculate the number of possible subnets, use the formula 2n, where n equals the number of host
bits borrowed.
•For example, if three host bits are borrowed, then n=3. 23 = 8, so eight subnets are possible if three
host bits are borrowed.

Possible Number of Hosts per Subnet


•To calculate the number of possible hosts per subnet, use the formula 2h - 2, where h equals the
number of host bits.
•The reason two addresses must be subtracted is because of the network address and the broadcast
address.
Problem-1:
Suppose a network with IP Address 192.16.0.0. is divided into 2 subnets, find number of hosts per
subnet.
Also for the first subnet, find
1.Subnet Address
2.First Host ID
3.Last Host ID
4.Broadcast Address
Solution-
• Given IP Address belongs to class C.
• So, 24 bits are reserved for the Net ID.
• The given network is divided into 2 subnets.
• So, 1 bit is borrowed from the host ID part for the subnet IDs.
• Then, Number of bits remaining for the Host ID = 7.
• Thus, Number of hosts per subnet = 27-2= 126.
For 1st Subnet-
• Subnet Address = First IP Address = 192.16.0.00000000 = 192.16.0.0
• First Host ID = 192.16.0.00000001 = 192.16.0.1
• Last Host ID = 192.16.0.01111110 = 192.16.0.126
• Broadcast Address = Last IP Address = 192.16.0.01111111 = 192.16.0.127

Problem-2
•Available Subnet - 215.37.1.0/24
•Required subnets – 25
•Number of bits to borrow=5
•New prefix=/27
•New subnet mask=255.255.255.248
•Number of hosts per subnet=25-2=32-2=30
•Subnets
–215.37.1.0
–215.37.1.8
–215.37.1.16…….
–215.37.1.248

Problem 3
•Subnet the Class C IP Address 195.1.1.0 So that you have 10 subnets each with a maximum 12 hosts on
each subnet. List the Address on host 1 on subnet 0,1,2,3,10.
•Sol. Current mask= 255.255.255.0
•Bits needs for 10 subnets =4
•Bits needs for 12 hosts = 4 , 16-2=14 possible hosts.
•So our mask in binary =11110000= 240 decimal
•Final Mask =255.255.255.240

Problem 4
• Subnet the Class C IP Address 205.11.2.0 so that you have 30 subnets. What is the subnet mask for the
maximum number of hosts? How many hosts can each subnet have? What is the IP address of host 3 on
subnet 2 ?
•Sol. Current mask= 255.255.255.0
•Bits needs for 30 subnets =5 =25 =32 possible subnets
•Bits left for hosts = 3 = 23 = 8-2=6 possible hosts.
•So our mask in binary =11111000= 248 decimal
• Final Mask =255.255.255.248
•Address of host 3 on subnet 2 is
• subnet 2 =00010000 host 3 =000000011
•Add the two together =00010011=19
•therefore IP address of host 3 on subnet 2 =205.11.2.19

What is not true about subnetting?


1.It is applied for a single network
2.It is used to improve security
3.Bits are borrowed from network portion
4.Bits are borrowed from Host portion

Practice Question
• You are working in a data center environment and are assigned the address range 10.188.31.0/23. You
are asked to develop an IP addressing plan to allow the maximum number of subnets with as many as 30
hosts each. Which IP address range meets these requirements?
•A. 10.188.31.0/27
•B. 10.188.31.0/26
•C. 10.188.31.0/29
•D. 10.188.31.0/28
•E. 10.188.31.0/25

•Answer: A
•Each subnet has 30 hosts
•2h-1=30
•h=5. So 5 host bits are required.
•Subnet prefix= 23+1+3=27 because maximum number of subnets are required.
Practice Question 2
If an Ethernet port on a router was assigned an IP address of 172.1.1.1/20, what is the maximum
number of hosts allowed on this subnet?
•A. 4094
•B. 1024
•C. 8190
•D. 2046
•E. 4096

•Answer: A
•Explanation:
In the prefix /20 we have 12 bit 0s so the number of hosts-persubnet is 212 – 2 = 4094

You might also like