You are on page 1of 177

Chapter 1

1
Chapter 1
Computer Networks

CS 6551

Unit 2

Prepared by

A.PRASANTH

2
Chapter 1
Unit 2
 Media access control - Ethernet
(802.3) - Wireless LANs – 802.11 –
Bluetooth - Switching and Bridging –
Basic Internetworking (IP, CIDR, ARP,
DHCP, ICMP)

3
Chapter 1
Medium Access Control

4
Chapter 1
Data Link layer - MAC

5
Chapter 1
 Data link layer is further subdivided into
two sub layers:

 Logical Link Control (LLC)

 Medium Access Control (MAC)

6
Chapter 1
Data Link Layer Sub layers
 Logical Link Control (LLC) – upper layer
Handles logical addressing, control information
and data
 Medium Access Control (MAC) – lower
layer
 Proprietary to specific LAN product (e.g.
Ethernet, Token Ring, Token Bus, etc.)
 Resolves contention for the medium, provides
synchronization, flow control, physical
addressing, and error control specifications

7
Chapter 1
MAC:
 Media access control (MAC) is a sub layer of
the data link layer (DLL) in the seven-layer OSI
network reference model. MAC is responsible for
the transmission of data packets to and from the
network-interface card(NIC), and to and from
another remotely shared channel.
 The MAC sub layer provides addressing
and channel access control mechanisms that
make it possible for several network nodes to
communicate within a multiple access network
that incorporates a shared medium, e.g.
an Ethernet network.

8
Chapter 1
Functions performed in the MAC 
 Frame delimiting and recognition
 Addressing of destination stations (both as
individual stations and as groups of
stations)
 Protection against errors, generally by
means of generating and checking frame
check sequences
 Control of access to the physical
transmission medium

9
Chapter 1
NIC 

A network interface card (NIC) is a


circuit board or card that is installed in a
computer so that it can be connected to
a network

10
Chapter 1
IEEE 802.3
Ethernet

11
IEEE 802.3 Ethernet

Chapter 1
Contents

•Ethernet collision
•CSMA/CD

•Frame Format

•Physical properties

•Ethernet Address/MAC address

•Categories of traditional Ethernet

12
Chapter 1
Ethernet
 Ethernet (802.3) is the most widely
installed local area network (LAN)
technology. 
 Ethernet is a link layer protocol in the
TCP/IP stack, describing how networked
devices can format data for transmission
to other network devices on the same
network segment, and how to put that data
out on the network connection.

13
Chapter 1
Ethernet
 802.3 is a standard specification
for Ethernet, a method of physical
communication in a LAN, which is
maintained by the IEEE.
 In general, 802.3 specify the physical
media and the working characteristics of
Ethernet. The original Ethernet supports a
data rate of 10 megabits per second
(Mbps)

14
Chapter 1
Normal Ethernet Operation
B C

Address mismatch Address mismatch


packet discarded packet discarded

Send data Address match


to node D packet processed
Transmitted packet seen
by all stations on the LAN
A (broadcast medium) D

Data

15
Chapter 1
Ethernet Collisions
B C

Collision

Data transmission for c Data transmission


for C
A
D

Two or more stations send the data frames to same


destination nodes which causes the collision in the network
is denoted as Ethernet collision.

16
Chapter 1
Ethernet (802.3)
 Overlapping signals are referred to as
collisions
 Increased stations  Increased traffic 

more collisions
 Carrier Sense Multiple Access with
Collision Detection (CSMA/CD) is used to
coordinate traffic, minimize collisions, and
maximize number of frames delivered
successfully

17
CSMA/CD - Access method

Chapter 1
 A network station wishing to transmit will first check
the cable plant to ensure that no other station is
currently transmitting (CARRIER SENSE).
 The communications medium is one cable, therefore,

it does allow multiple stations access to it with all


being able to transmit and receive on the same cable
(MULTIPLE ACCESS).
 Error detection is implemented throughout the use of

a station "listening" while it is transmitting its data.


 A jam signal is transmitted to network by the transmitting
stations that detected the collision, to ensure that all
stations know of the collision. All stations will "back off"
for a random time.
 Detection and retransmission is accomplished in micro
seconds. Two or more stations transmitting causes a
collision (COLLISION DETECTION)

18
Chapter 1
Ethernet Frame Format
 Consists of seven fields
 No mechanism for acknowledging received
frames; considered an unreliable medium

19
Chapter 1
Ethernet Frame Fields
 Preamble – seven bytes of alternating 0s and 1s
to notify receiver of incoming frame and to
provide synchronization
 Start frame delimiter (SFD) – one byte signaling
the beginning of the frame
 Destination address (DA) – six bytes containing
the physical address of the next destination; if
packet must reach another LAN, this field
contains the physical address of the router; upon
reaching the target network, field then contains
the physical address of the destination device

20
Chapter 1
Ethernet Frame Fields (cont)
 Source address (SA) – six byte field
containing physical address of last station
to forward packet, sending station or most
recent router
 Length/type – two bytes indicating number
of bytes in coming PDU; if fixed length, can
indicate type
 Data – 46 to 1500 bytes – Data information
available, DSAP – Destination Service
Access Point
 CRC – CRC-32 error detection information
21
Chapter 1
PHYSICAL PROPERTIES

Ethernet segments were originally implemented


using coaxial cable of length up to 500 m.
Hosts connected to an Ethernet segment by tapping
into it.

22
Chapter 1
PHYSICAL PROPERTIES

 A transceiver, a small device directly


attached to the tap, detected when the line
was idle and drove the signal when the
host was transmitting. It also received
incoming signals.
 The transceiver, in turn, connected to an
Ethernet adaptor, which was plugged into
the host.

23
Chapter 1
Ethernet Addressing / MAC
Addressing / Physical Addressing
 Each station on the network must have a unique
physical address
 Provided by a six-byte physical address (48
bit)encoded on the network interface card (NIC)
 Normally written in hexadecimal notation

24
Chapter 1
Categories of traditional Ethernet
 There are four important categories in
traditional Ethernet such as
 10Base5,

 10Base2,

 10-Base-T,

 10Base-FL

 First number indicates data rate in Mbps


 Last number indicates maximum cable length
or type

25
Chapter 1
10Base5 - Thicknet

 A rigid coaxial
cable (RG-8)
approx. 0.4 in.
thick used in the
original Ethernet
networks
 Bus topology LAN
using base
signaling with a
maximum segment
distance of 500
meters 26
Chapter 1
Thicknet Characteristics
 Supports transmission rates up to 10 Mbps
in Baseband mode
 Less expensive than fiber-optic cable, but
more expensive than other types of coax
 Wide diameter and excellent shielding
make it more resistant to noise than other
types of wiring
 Physical connectors and cables include
coaxial cable, NIC cards, transceivers, and
attachment unit interface (AUI) cables

27
Chapter 1
10Base5 Connectors
 Transceiver – intermediary device; also called a
medium attachment unit (MAU)
 Performs CSMA/CD function; may contain small buffer
 Attachment Unit Interface (AUI) – also called a
transceiver cable
 15-wire cable which performs physical layer interface
functions between station and transceiver
 Plugs into NIC and transceiver
 Transceiver tap – allows connection to a line at
any point
 Often called a vampire tap since it pierces the cable

28
Chapter 1
10Base5 Topology

29
Chapter 1
10Base5 Connectors

AUI
Cable/Transcei 10Base5 network
configuration
ver Cable

30
Chapter 1
10Base2 - Thinnet
 Cable diameter is approximately 0.64 cm (RG-58)
 More flexible and easier to handle and install than
Thicknet
 “2” represents a maximum segment length of
185m (~200m)
 Less expensive than Thicknet and fiber-optic
cable; more expensive than Twisted Pair wiring
 More resistant to noise than Twisted Pair; not as
resistant as Thicknet
 Major advantages are its very low cost and relative
ease of use
31
Chapter 1
Thinnet Characteristics
 Shorter range (185 meters) and smaller capacity
 Bus topology LAN
 Connectors and cables include: NICs, thin
coaxial cable, and BNC-T connectors
 Transceiver is moved into NIC; tap replaced by
connector splicing directly into the cable,
eliminating need for AUI cables
 BNC-T connector – T-shaped device with 3
ports: one for the NIC and one each for
input/output ends of cable

32
Chapter 1
ThinNet Cabling & Connectors

T-connector CRO - connector

33
Chapter 1
10Base-T: Twisted Pair Ethernet
 Most popular standard; easiest to install
and reconfigure
 Star topology LAN using UTP cable; no
need for AUI
 Supports data rage of 10 Mbps with a max
hub to station length of 100 meters
 Transceiver operations are carried out in an
intelligent hub
 NIC reads destination address of frame
and only opens if it matches that
address
34
Chapter 1
10Base-T

35
Chapter 1
RJ 45

RJ 45 is 8 pin cable. Used


as direct connector and
cross connector.
36
Chapter 1
10Base-FL: Fiber Link Ethernet

 Uses star topology to


connect stations to a
hub
 External transceiver
called a fiber-optic
MAU connects
processing device to
fiber-optic cables via
a 15-wire transceiver

37
Chapter 1
Wireless LANs

 Wireless Ethernet (IEEE 802.11)

38
Chapter 1
39
a
a
Chapter 1
Wireless LAN (802.11)
 WLANs are flexible data communications
systems implemented as an extension or as an
alternative for wired LANs.
 Using radio frequency (RF) technology, WLANs
transmit and receive data over the air,
minimizing the need for wired connections.
 Thus, WLANs combine data connectivity with
user mobility.
 WLANs are simple to install.

40
Chapter 1
Wireless LAN
Wireless LAN Technologies

Four prominent wireless technologies:

 Wi-Fi(more formally known as 802.11)


 Blue tooth(802.15.1)
 WiMAX (802.16)
 Third generation or 3Gcellular wireless.

41
Chapter 1
Wireless LAN
Advantages:
  Freedom of Mobility.

 Reduced cost of ownership.

 Provide high-speed, reliable data

communications.
Application:
 The health-care ,education, industry are also

fast-growing markets for WLANs.


 WLANs provide high-speed, reliable data

communications in a building or campus


environment as well as coverage in rural areas.
42
Chapter 1
Wireless Ethernet (IEEE 802.11)

43
Chapter 1
Content
 Architecture
 Physical layer
 MAC layer
 Frame format

44
Chapter 1
Wireless Ethernet (802.11)
 802.11 is designed for use in a limited
geographical area (homes, office
buildings, campuses) and its primarily
challenge is to mediate access to a shared
communication medium in this case,
signals propagating through space.

 Operates on physical and data link layers

45
Chapter 1
802.11 Architecture
 Architecture consist of two services
 BSS
 ESS
 Basic service set (BSS) – stationary or mobile wireless
stations and a central base station known as an access
point (AP)
 Without an AP is an ad hoc architecture

46
Chapter 1
802.11 Architecture (cont)

ESS

 Extended service set (ESS) – two or more


BSSs with APs connected through a distribution
system (wired LAN) in an infrastructure network

47
Chapter 1
Physical Layer
 In 802.11 physical layer has Five important specifications
such as

802.11 FHSS

 802.11 DSSS
 802.11a OFDM
 802.11b HR-DSSS – (Wi-Fi)
Physical Layer
 802.11g OFDM

48
Chapter 1
802.11 FHSS
 Frequency-hopping spread spectrum in a
2.4 GHz band, the globally free available
frequency band, for spread spectrum
communication.
 FHSS is a method of transmitting radio
signals by rapidly switching a carrier
among many frequency channels, using a
pseudorandom sequence known to both
transmitter and receiver.

49
802.11 FHSS (cont)

Chapter 1
 Contention is handled by MAC sub layer since all stations
use the same sub bands
 Pseudorandom number generator selects the hopping
sequence
 Data rate is of 1 or 2 Mbps
 Modulation Techniques - FSK

50
802.11 DSSS

Chapter 1
 Direct sequence spread spectrum in a 2.4 GHz band
 Each bit is replaced by a sequence of bits called a chip
code, implemented at the physical layer
 Sender splits each byte of data into several parts and
sends them concurrently on different frequencies
 Data rate is 1 or 2 Mbps
 Modulation Techniques – PSK,BPSK,QPSK

51
Chapter 1
802.11a OFDM
 Orthogonal frequency-division multiplexing
using a 5-GHz band
 Method of Digital Communication that
breaks a large bandwidth into small
subcarriers (sub bands)
 Security increased by assigning sub bands
randomly
 Data rates of 18 Mbps and 54 Mbps
 Often used in power-line networking
 Modulation Techniques – PSK & QAM
52
Chapter 1
802.11 MAC Layer
 802.11 MAC layer having two significant
problems such as
 Hidden Terminal problem
 Exposed Terminal problem

53
Chapter 1
Hidden Terminal problem
 Suppose both A and C want to
communicate with B and so they each
send it a frame.
 A and C are unaware of each other since their
signals do not carry that far
 These two frames collide with each other at B
 But unlike an Ethernet, neither A nor C is aware of
this collision
 A and C are said to hidden nodes with respect
to each other

54
Chapter 1
Hidden Terminal problem

The “Hidden Node” Problem. Although A and C are hidden from each
other, their signals can collide at B. (B’s reach is not shown.)

55
Chapter 1
Exposed Terminal problem
 Another problem called exposed node
problem occurs
 Suppose B is sending to A. Node C is aware
of this communication because it hears B’s
transmission.
 It would be a mistake for C to conclude that it
cannot transmit to anyone just because it can
hear B’s transmission.
 Suppose C wants to transmit to node D.
 This is not a problem since C’s transmission to
D will not interfere with A’s ability to receive
from B.
56
Chapter 1
Exposed Terminal problem

Exposed Node Problem. Although B and C are exposed to each other’s


signals, there is no interference if B transmits to A while C transmits to D. (A and D’s
reaches are not shown.)

57
Chapter 1
CSMA/CA – Access method
 Carrier Sense Multiple Access with Collision
Avoidance (CSMA/CA) is a random access
scheme with carrier sense and collision
Wait a avoidance
DIFS time tothrough random backoff.
avoid collision
Backoff is the waiting time taken by the station
Send RTSfromandcontention window.
waitforContention
CTS reply to window is the collection of time
obtain the use of the
Medium slots
(air) taken by station as waiting time before
listening their channel.
Use of SIFS time
 Inter Frame Space (IFS) is the waiting time
for control information
before starting data transmit by mobile node.
 SIFS - Short IFS, DIFS - DCF IFS

58
Chapter 1
CSMA/CA
 Necessary since wireless LANs cannot
implement CSMA/CD
 Collision detection requires increased
bandwidth requirements
 Collisions might not be detected due to
obstacles
 Distance between stations may prevent
collisions from being heard
 Collision avoidance is accomplished
through Network Allocation Vector (NAV)

59
Chapter 1
Network Allocation Vector
 NAV (Network Allocation Vector) is the waiting time by
other station except sender
 Timer which shows how much time must pass before a
station is allowed to check the channel

RTS – Ready To Send ,CTS – Clear To Send

60
Chapter 1
IEEE 802.11 – Frame Format
 Source and Destinations addresses: each 48 bits
 Data: up to 2312 bytes
 CRC: 32 bit
 Control field: 16 bits
 Contains three subfields (of interest)
 6 bit Type field: indicates whether the frame is an RTS or CTS frame or
being used by the scanning algorithm
 A pair of 1 bit fields : called ToDS and FromDS

Frame Format

61
Chapter 1
IEEE 802.11 – Frame Format
 Frame contains four addresses
 How these addresses are interpreted depends
on the settings of the ToDS and FromDS bits in
the frame’s Control field
 Simplest case
 When one node is sending directly to another, both
the DS bits are 0, Addr1 identifies the target node,
and Addr2 identifies the source node.

62
Chapter 1
IEEE 802.11 – Frame Format
 Most complex case
 Both DS bits are set to 1
 Addr1 identifies the ultimate destination,
 Addr2 identifies the immediate sender (the

one that forwarded the frame from the


distribution system to the ultimate
destination)
 Addr3 identifies the intermediate destination

(the one that accepted the frame from a


wireless node and forwarded across the
distribution system)
 Addr4 identifies the original source

63
Chapter 1
Addr1: E, Addr2: AP-3, Addr3: AP-
1, Addr4: A

64
Chapter 1
Bluetooth (IEEE 802.15.1)

65
Chapter 1
Bluetooth
 Bluetooth is wireless technology that connects
cell phones or other devices without using
cables.
 802.15.1 is a standard specification for 
Bluetooth, which is maintained by the IEEE.
 Bluetooth is the WPAN (Wireless Personal Area
Network) and it is the cable replacement
technology.
 Symbol rate of Bluetooth is 1 mbps and it has
short range communication (nearly 10 m).
 It operates at the same 2.4-GHz band.

66
Chapter 1
Bluetooth Architecture

67
Chapter 1
Radio (Physical) layer
 Radio layer is the specification of the air
interface, i.e., frequencies, modulation, and
transmit power.
 The radio layer of Bluetooth utilizes the 2.4-
GHz ISM band.
 The modulation scheme is GFSK at a rate of
1 bit per Hz, providing a data rate of 1 Mbps.
 Bluetooth transceivers use Gaussian FSK for
modulation and are available in three classes:
Power class 1, Power class 2, Power class
3.
68
Chapter 1
Baseband layer
 Baseband layer gives detailed description
of basic connection establishment, packet
formats, timing, and basic QoS
parameters.
 The baseband layer controls
transmission of frames in association with
frequency hopping.
 Topology
 Piconet
 Scatternet

69
Chapter 1
Piconet
 Collection of devices connected in
an ad hoc fashion
 One unit acts as master and the
others as slaves for the lifetime of
the piconet
 Master determines hopping
pattern, slaves have to
synchronize
 Each piconet has one master and
up to 7 slaves
M=Master P=Parked
S=Slave SB=Standby

70
Chapter 1
Scatternet
 Groups of piconets called scatternet.
 Linking of multiple co-located piconets through
the sharing of common master or slave
devices
 Devices can be slave in one piconet and master of
another

71
Chapter 1
Link manager protocol (LMP)
 Link manager protocol (LMP) deals with Link
set-up and management between devices
including security functions and parameter
negotiation.
 The major function of LMP are
 Power management

 Security management

 Synchronization

 Quality of service negotiation.

72
Chapter 1
Bluetooth Packet Format

73
Chapter 1
Operational states of Bluetooth
 Every device, which is currently not participating in a piconet (and
not switched off), is in standby mode. This is a low-power mode
where only the native clock is running. The next step towards the
inquiry mode can happen in two different ways.

74
Operational states of Bluetooth

Chapter 1
 Either a device wants to establish a piconet or a device just
wants to listen to see if something is going on. If the inquiry was
successful, a device enters the page mode.
 During the page state two different roles are defined. After
finding all required devices the master is able to set up
connections to each device, i.e., setting up a piconet.
 Depending on the device addresses received, the master
contact each device individually. The slaves answer and
synchronize with the master’s clock. The connection state
comprises the active state and the low power states - park, sniff,
and hold.
 In the active state the slave participates in the piconet by
listening, transmitting, and receiving. A master periodically
synchronizes with all slaves. All devices being active must have
the 3-bit Active Member Address (AMA). Within the active
state devices either transmits data or is simply connected.
75
Chapter 1
SWITCHING AND BRIDGING

76
Chapter 1
Basics Components:

77
Chapter 1
BRIDGING

78
Chapter 1
Bridge:
 A bridge is a type of computer network
device that provides interconnection with
other bridge networks that use the same
protocol.
 Bridge devices work at the data link layer
of the OSI model, connecting two different
networks together and providing
communication between them.
 Bridges are also known as Layer 2
switches.

79
Chapter 1
Bridge/Function of Bridge:
 Connects two or more LANs at the link
layer
 Extracts destination address from the frame
 Looks up the destination in a table
 Forwards the frame to the appropriate LAN
segment
 A bridge works on the principle that each
network node has its own address. A
bridge forwards the packets based on the
address of the particular destination node.

80
Chapter 1
Bridge:

81
Chapter 1
Bridge:

82
Chapter 1
Bridge Filtering
 bridges learn which hosts can be reached through which
interfaces: maintain filtering tables
 when frame received, bridge “learns” location
of sender: incoming LAN segment
 records sender location in filtering table
 filtering table entry:
 (Node LAN Address, Bridge Interface, Time
Stamp)
 stale entries in Filtering Table dropped (TTL
can be 60 minutes)

83
Chapter 1
Bridge Operation
 bridge procedure(in_MAC, in_port,out_MAC)
Set filtering table (in_MAC) to in_port /*learning*/
lookup in filtering table (out_MAC) receive out_port
if (out_port not valid) /* no entry found for destination */
then flood; /* forward on all but the interface on
which the frame arrived*/

if (in_port = out_port) /*destination is on LAN on which


frame was received */
then drop the frame

Otherwise (out_port is valid) /*entry found for destination */


then forward the frame on interface indicate

84
Chapter 1
Bridge Learning: example
Suppose C sends frame to D and D replies back with
frame to C

 C sends frame, bridge has no info about D, so floods


to both LANs
 bridge notes that C is on port 1
 frame ignored on upper LAN
 frame received by D

85
Chapter 1
Bridge Learning: example

C 1

 D generates reply to C, sends


 bridge sees frame from D
 bridge notes that D is on interface 2
 bridge knows C on interface 1, so selectively
forwards frame out via interface 1

86
What will happen with loops?

Chapter 1
Incorrect learning – Looping
problem
B

2 2
Bridge Bridge

1 1
A

87
Chapter 1
Looping problem in Bridge
 Bridge loop occurs in computer networks
when there is more than one Layer 2 (OSI
model) path between two endpoints (e.g.
multiple connections between two network
or two ports on the same LAN connected
to each other.
 To solve the looping problem, the bridges
use the spanning tree algorithm to
create a loop less topology.

88
Chapter 1
Spanning Tree Requirements
 Allow a path between every LAN without
causing loops (loop-free environment)
 Each bridge is assigned a unique
identifier
 A broadcast address for bridges on a LAN
 A unique port identifier for all ports on all
bridges
 MAC address
 Bridge id + port number

89
Chapter 1
Spanning Tree Algorithm:
 1. Determine the root bridge among all
bridges
 2. Each bridge determines its root port
 The port in the direction of the root bridge
 3. Determine the designated bridge on
each LAN
 The bridge which accepts frames to forward
towards the root bridge
 The frames are sent on the root port of the
designated bridge

90
Chapter 1
Spanning Tree Algorithm:
Selecting Root Bridge
 The bridge with the lowest bridge ID value is elected the
root bridge
 Every other bridge calculates a path to the root bridge
 Initially, each bridge considers itself to be the root bridge
 Bridges send BDPU(bridge protocol data unit) frames to
its attached LANs
 The bridge and port ID of the sending bridge
 The bridge and port ID of the bridge the sending bridge
considers root
 The root path cost for the sending bridge
 Best one wins
 (lowest root ID/cost/priority)

91
Chapter 1
Spanning Tree Algorithm: Selecting Root Ports
 Each bridge selects one of its ports which
has the minimal cost to the root bridge
 In case of a tie, the lowest uplink
(transmitter) bridge ID is used
 In case of another tie, the lowest port ID is
used.
Forwarding/Blocking State
 Root and designated bridges will forward
frames to and from their attached LANs
 All other ports are in the blocking state
92
Chapter 1
Example Spanning Tree

B8
B3
B5 Protocol operation:
B7
B2 1.
2.
Picks a root
For each LAN,
picks a designated bridge

B1 3.
that is closest to the root.
All bridges on a LAN
send packets towards the
root via the designated

B6
bridge.
B4

93
Chapter 1
Example Spanning Tree

B8
B3 Spanning Tree:
B5
root
B1

port B7
B2 B2 B4 B5 B7

B1
Root B8
Designated
B6 Bridge
B4

94
Switch:

Chapter 1
 A switch, in the context of networking is a
high-speed device that receives incoming data
packets and redirects them to their destination
on a local area network (LAN).
 A mechanism that allows us to interconnect
links to form a large network. A multi-input,
multi-output device which transfers packets
from an input to one or more outputs.
 A switch’s primary job is to receive incoming
packets on one of its links and to transmit
them on some other link
 This function is referred as switching and
forwarding
95
Chapter 1
Switch:

96
Chapter 1
Switching
Describe how data
is processed and
A physical link is
routed in the N/W
dedicated between
source &
Destination

Data can be sent as


a stream of bits
without the need
for packetizing

97
Chapter 1
Circuit Switching
 Circuit switching is a method of implementing
a telecommunications network in which
two network nodes establish a dedicated
communications channel (circuit) through
the network before the nodes may
communicate.
 A circuit network is heavily dependent on the
number of channel available.
 Example – Telephone landline connection

98
Chapter 1
Circuit Switching

Circuit Switch

Internet
Circuit Switch

Circuit Switch

99
Chapter 1
Packet Switching
 In packet based networks, the message
get broken into small data packets.
 Each packet is sent with a header
addresses. This header address tells it
where its final destination is, so it knows
where to go.
 Packet switching is done by
 Datagram approach (Connectionless)
 Virtual circuit approach(Connection oriented)

100
Chapter 1
Datagram approach
 Every packet contains enough information
to enable any switch to decide how to get it
to destination
 Every packet contains the complete destination address

 Switch maintains a forwarding table


(sometimes called a routing table) which is
used to forward a packet.

101
Chapter 1
Switching and Forwarding
Destination Port
----------------------------------
---
A 3
B 0
C 3
D 3
E 2
F 1
G 0
H 0

Forwarding Table for


Switch 2

102
Chapter 1
Datagram approach
Characteristics of Connectionless (Datagram) Network
 A host can send a packet anywhere at any time,
since any packet that turns up at the switch can be
immediately forwarded (assuming a correctly
populated forwarding table)

 When a host sends a packet, it has no way of


knowing if the network is capable of delivering it or if
the destination host is even up and running.

 A switch or link failure might not have any serious


effect on communication if it is possible to find an
alternate route around the failure and update the
forwarding table accordingly
103
Chapter 1
Virtual Circuit Switching
 Widely used technique for packet switching
 Uses the concept of virtual circuit (VC)
 Also called a connection-oriented model
 First set up a virtual connection from the
source host to the destination host and then
send the data
Two-stage process
 Connection setup
 Data Transfer

104
Chapter 1
Switching and Forwarding
 Connection setup phase
 Establish “connection state” in each of the switches
between the source and destination hosts
 The connection state for a single connection consists
of an entry in the “VC table” in each switch through
which the connection passes
 One entry in the VC table on a single switch contains
 A virtual circuit identifier (VCI) that uniquely identifies the connection
at this switch and that will be carried inside the header of the
packets that belong to this connection
 An incoming interface on which packets for this VC arrive at the
switch
 An outgoing interface in which packets for this VC leave the switch
 A potentially different VCI that will be used for outgoing packets

105
Chapter 1
Switching and Forwarding
Two broad classes of approach to establishing connection
state

 Network Administrator will configure the state


 The virtual circuit is permanent (PVC)
 The network administrator can delete this
 Can be thought of as a long-lived or administratively configured VC

 A host can send messages into the network to cause the state to
be established
 This is referred as signalling and the resulting virtual circuit is said to
be switched (SVC)
 A host may set up and delete such a VC dynamically without the
involvement of a network administrator

106
Chapter 1
Switching and Forwarding

 Let’s assume that a network administrator wants to


manually create a new virtual connection from host A to
host B
 First administrator identifies a path through the network from A to B

107
Chapter 1
Switching and Forwarding
The administrator then picks a VCI value that is
currently unused on each link for the connection
 For our example,
 Suppose the VCI value 5 is chosen for the link from host A to
switch 1
 11 is chosen for the link from switch 1 to switch 2

 So the switch 1 will have an entry in the VC table

Similarly, suppose
 VCI of 7 is chosen to identify this connection on the link from switch 2 to
switch 3
 VCI of 4 is chosen for the link from switch 3 to host B
 Switches 2 and 3 are configured with the following VC table

108
Chapter 1
VC table

Incoming Outgoing
Switch Incoming VCI Outgoing VCI
Interface Interface

1 2 5 1 11

2 3 11 2 7

3 0 7 1 4

109
Chapter 1
Switching and Forwarding
Data Transfer Phase:
 For any packet that A wants to send to B, A puts the VCI value 5 in
the header of the packet and sends it to switch 1
 Switch 1 receives any such packet on interface 2, and it uses the
combination of the interface and the VCI in the packet header to find
the appropriate VC table entry.
 The table entry on switch 1 tells the switch to forward the packet out
of interface 1 and to put the VCI value 11 in the header

110
Chapter 1
Switching and Forwarding
 Packet will arrive at switch 2 on interface 3 bearing VCI 11
 Switch 2 looks up interface 3 and VCI 11 in its VC table and sends
the packet on to switch 3 after updating the VCI value appropriately
 This process continues until it arrives at host B with the VCI value of
4 in the packet
 To host B, this identifies the packet as having come from host A

111
Chapter 1
112
Chapter 1
Internetworking

113
Chapter 1
Internetworking
Internetwork is a collection of networks
interconnected to provide host – host packet
delivery services.

114
Chapter 1
Internetworking

IP
CIDR
ARP
DHCP
ICMP

115
Chapter 1
IP

Internet Protocol (IP)

116
Chapter 1
IP Address (Extra)

117
Chapter 1
Internet Protocol (IP)
 An Internet Protocol (IP) is a protocol by which data is sent
from one computer to another on the internet.
 An Internet Protocol address (IP address) is a numerical label
assigned to each device (e.g., computer, printer) participating in
a computer network that uses the Internet Protocol for
communication
 IPv4 – 32 bit,IPv6 – 128 bit

A simple internetwork showing the protocol layers

118
Chapter 1
Packet Format
 Version (4): currently 4
 Hlen (4): number of 32-bit words
in header
 TOS (8): type of service (not
widely used)
 Length (16): number of bytes in
this datagram
 Ident (16): used by fragmentation
 Flags/Offset (16): used by
fragmentation
 TTL (8): number of hops this
datagram has traveled
 Protocol (8): demux key (TCP=6,
UDP=17)
 Checksum (16): of the header
only
 DestAddr & SrcAddr (32)

119
Chapter 1
IP Fragmentation and Reassembly
 Fragmentation occurs in a router when it
receives a datagram that it wants to forward
over a network which has (MTU < datagram)
 Each network has some MTU (Maximum
Transmission Unit)
 Ethernet (1500 bytes)
 Reassembly is done at the receiving host
 All the fragments carry the same identifier in
the Ident field

120
Chapter 1
IP Fragmentation and Reassembly (EXTRA)

121
Chapter 1
IP Fragmentation and Reassembly

IP datagrams traversing the sequence of physical networks

122
Chapter 1
IP Fragmentation and Reassembly

 Receives data from Transport layer


 Responsible for creating Packet
 Each packet contains
 Universal Address of Source

 Universal Address of Destination

 Makes sure the packet is correct size.


 If the packet is too large,
 Then it will be fragmented
 Also add fields for error control

123
Datagram Forwarding in IP

Chapter 1
 Forwarding is the process of taking a packet
from an input and sending it out on the
appropriate output.
 The constrains for forwarding of IP datagram‘s
 Every IP datagram contains the IP address of the
destination host.
 The network part of an IP address uniquely identifies
a single physical network that is part of the larger
Internet.
 All hosts and routers that share the same network part
of their address are connected to the same physical
network.
 Every physical network that is part of the Internet has
at least one router.
124
Datagram forwarding algorithm

Chapter 1
if (NetworkNum of destination = NetworkNum of one of my
interfaces) then
deliver packet to destination over that interface
else
if (NetworkNum of destination is in my forwarding table) then
deliver packet to NextHop router
else
deliver packet to default router

For a host with only one interface and only a default router in its
forwarding table, this simplifies to
if (NetworkNum of destination = my NetworkNum) then
deliver packet to destination directly
else
deliver packet to default router

125
Datagram Forwarding in IP

Chapter 1
 Forwarding IP datagrams can therefore be handled in
the following way:
 A datagram is sent from a source host to a

destination host, possibly passing through several


routers along the way.
 Any node, whether it is a host or a router, first tries

to establish whether it is connected to the same


physical network as the destination.
 If the node is not connected to the same physical

network as the destination node, then it needs to


send the datagram to a router.
 The forwarding table is conceptually just a list of

(NetworkNum, NextHop) pairs.


126
Chapter 1
IP Addressing – IPv4 -Global
address
 IP address is a 32 bit address that
uniquely and universally define a host or
router connected to the internet.
 Two common notation
 Binary notation
 Dotted decimal notation (192.168.25.123)

127
Chapter 1
IP Addressing

32 bits
Dotted
Decimal Network id Host id

Maximum255 255 255 255

• The router identifies correct network using


Network id ,host using host id

128
Chapter 1
IP Addressing

32 bits
Dotted
Decimal Network Host

Maximum255 255 255 255

Binary 11111111111111111111111111111111

64
32

8
4
2
1
128

16
64
32
16
128

8
4
2
1
64

64
32
16
128

32
16
8
4
2
1

128

8
4
2
1

129
IP Addressing

Chapter 1
32 bits
Dotted
Decimal Network Host

Maximum255 255 255 255

Binary 11111111111111111111111111111111

128
64
32
16
8
4
2
1
128
64
32
16
8
4
2
1
128
64
32
16

128
64
32
16
8
4
2
1

8
4
2
Example 1

Decimal 172 16 122 204


Example10101100000100000111101011001100
Binary
130
Example

Chapter 1
Change the following IPv4 addresses from binary notation
to dotted-decimal notation.

131
Example

Chapter 1
Change the following IPv4 addresses from binary notation
to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation.

132
Chapter 1
IP Addressing – Types of Architecture
 There are two broad types of IP address
namely,
 Classful addressing
 Classless addressing
Classful addressing
 The address space is divided into five types

 Class A
 Class B
 Class C
 Class D
 Class E

133
IP Addressing

Chapter 1
Range – First
Byte
Class Number of network & host Purpose
Dotted
decimal
Binary

N - 28, H - 224
A 0-127 0 Unicast
Network
Network Host
Host Host
Host Host
Host

N - 216, H - 216
Unicast
B 128-191 10
Network
Network Network
Network Host
Host Host
Host

N - 224, H - 28 Unicast
C 192-223 110
Network
Network Network
Network Network
Network Host
Host

D 224-239 1110 NA Multicast

E 240-255 11111 NA Research

134
Example

Chapter 1
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

135
Example

Chapter 1
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
136
Chapter 1
IP Addressing – Types (EXTRA)
 Public address
 A public IP address is the address that is assigned
to a computing device to allow direct access over
the Internet
 Private address
 A private IP address is the address space allocated
by InterNIC to allow organizations to create their
own private network.
 However, the devices residing outside of your local
network cannot directly communicate via the
private IP address, but uses your router's public IP
address to communicate.

137
Chapter 1
IP Addressing – NAT

138
Chapter 1
IP Addressing – Types (EXTRA)
 To allow direct access to a local device which
is assigned a private IP address, a Network
Address Translator (NAT) should be used.

139
Chapter 1
CIDR- Classless Inter domain Routing
 CIDR (Classless Inter-Domain Routing) is a
way to allow more flexible allocation of
Internet Protocol (IP) addresses than was
possible with the original system of IP
address classes.
 In classful addressing, a large part of the
available addresses were wasted.
 Classful addressing, which is almost
outdated, is replaced with classless
addressing.
 It was denoted by /n
140
Chapter 1
CIDR representation
For example : CIDR is represented by
192.255.255.255/12
• CIDR IP addresses are composed of two sets
of numbers.
•The network address is written as a prefix, like
you would see a normal IP address
(e.g. 192.255.255.255).
•The second part is the suffix which indicates
how many bits are in the entire address
(e.g. /12)

141
Chapter 1
Subnetting
 CIDR is based on a concept called
subnetting. Subnetting allows you to take a
class, or block of IP addresses and further
chop it up into smaller blocks, or groups of
IPs. 
 In another way, Sub netting is a process of
dividing large network into the smaller
network.
 Since an organization may not have enough
address, subnetting may be used to divide
the network into smaller networks or
subnetworks.
142
Chapter 1
Addressing without Subnets

143
Chapter 1
Addressing with Subnets

144
Chapter 1
Subnet mask - Default mask

145
Default subnet mask

Chapter 1
Network address to route the
packet:

146
Chapter 1
Note

The first address in the block can


be found by setting the rightmost
32 − n bits to 0s.

147
Example

Chapter 1
A block of addresses is granted to a small organization. We
know that one of the addresses is 205.16.37.39/28. What is
the first address in the block?
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111

If we set 32−28 rightmost bits to 0, we get

11001101 00010000 00100101 00100000


or
205.16.37.32.
148
Chapter 1
Note

The last address in the block can


be found by setting the rightmost
32 − n bits to 1s.

149
Example

Chapter 1
Find the last address for the 205.16.37.39/28.

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get

11001101 00010000 00100101 00101111


or
205.16.37.47

150
Chapter 1
Note

The number of addresses in the block


can be found by using the formula
232−n.

151
Example

Chapter 1
Find the number of addresses 205.16.37.39/28.

Solution

The value of n is 28, which means that number


of addresses is 2 32−28 or 16.

152
Chapter 1
ARP – Address Resolution Protocol

153
Chapter 1
ARP – Address Resolution Protocol

 The delivery of a packet to a host or a


router requires two levels of addressing:
logical and physical.
 We need to be able to map a logical
address to its corresponding physical
address and vice versa is done using ARP
and RARP.
 ARP is a protocol for mapping an IP
address to a physical address that is
recognized in local network.
154
Chapter 1
ARP – Address Resolution Protocol

155
Chapter 1
ARP –Packet format

156
ARP –Four cases

Chapter 1
157
Chapter 1
DHCP–Dynamic Host Configuration Protocol

158
Chapter 1
DHCP–Dynamic Host Configuration Protocol
 DHCP is a standardized network
protocol used on IP networks.
 The DHCP protocol is controlled by a
DHCP server that dynamically distributes
network configuration parameters, such
as IP addresses services.
 A DHCP server is used to manage the
allocation of IP configuration information
by automatically assigning IP addresses to
systems configured to use DHCP.
159
Chapter 1
DHCP–Dynamic Host Configuration Protocol

160
Chapter 1
DHCP–Packet format

161
Chapter 1
DHCP–packet format
 When trying to obtain configuration information, the
client puts its hardware address (e.g., its Ethernet
address) in the chaddr field.
 The DHCP server replies by filling in the yiaddr (“your”
IP address) field and sending it to the client.
 Other information such as the default router to be used
by this client can be included in the options field.
 In the case where DHCP dynamically assigns IP
addresses to hosts, it is clear that hosts cannot keep
addresses indefinitely.
 DHCP allows addresses to be leased for some period
of time. Once the lease expires, the server is free to
return that address to its pool

162
Chapter 1
DHCP–Operation

163
Chapter 1
DHCP–Methods
 Depending on implementation, the DHCP
server may have three methods of
allocating IP addresses:
 Dynamic allocation
 Automatic allocation
 Manual allocation (commonly called static
allocation)

164
Chapter 1
DHCP–Methods
Dynamic allocation
  A network administrator reserves a range

of IP addresses for DHCP, and each


DHCP client on the LAN is configured to
request an IP address from the
DHCP server during network initialization.
Automatic allocation
  The DHCP server permanently assigns an

IP address to a requesting client from the


range defined by the administrator.
165
Chapter 1
DHCP–Methods
Manual allocation (commonly called
static allocation)
 The DHCP server is disabled and the
administrator allocates a private IP
address based on a preconfigured
mapping to each client's MAC address.

166
Chapter 1
ICMP – Internet Control Message Protocol

167
Chapter 1
ICMP – Internet Control Message Protocol
 The IP protocol has no error-reporting or
error-correcting mechanism.
 The IP protocol also lacks a mechanism
for host and management queries.
 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 always reports error messages to
the original source.
168
Chapter 1
ICMP –Packet format

169
Chapter 1
ICMP –Contents of data field for the error messages

170
Chapter 1
ICMP –Utility
 Many commonly used network utilities
(traceroute and ping) are based on ICMP
messages.
 The traceroute command can be
implemented by transmitting IP datagrams.
 The related ping utility is implemented
using the ICMP echo request and echo
reply messages.

171
Chapter 1
ICMP – Query messages

172
Chapter 1
ICMP – Echo Request and Reply

173
Chapter 1
ICMP – Timestamp

174
Chapter 1
ICMP – Error messages

175
Chapter 1
University Questions
S.no Topic Examination

1 Media access control Apr/May 2011,Nov/Dec 2015

2 Ethernet (802.3) Nov/Dec 2012, Apr/May 2015

3 Wireless LANs – 802.11 Nov/Dec 2012,17, Apr/May 2015,16,17

4 Bluetooth Apr/May 2013,Nov 2017

5 Switching and Bridging Nov/Dec 2010,12,14, Apr/May 11,13,14

6 Internetworking Apr/May 2011,16,Nov 2017

7 IP Nov/Dec 2010,17,12,13, Apr/May 11,14

176
Chapter 1
Thank You

177

You might also like