0% found this document useful (0 votes)
26 views102 pages

Chapter 4 Part 1

Chapter 4 introduces protocols as essential rules for communication in both human and computer contexts, emphasizing their role in ensuring effective data transmission in networks. It discusses various flow control techniques, error control mechanisms, and the OSI model's layered architecture, detailing how data is managed and transmitted across different layers. The chapter highlights the importance of protocols in maintaining reliable communication and addresses common methods for error detection and correction.

Uploaded by

eyibeltal3939
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views102 pages

Chapter 4 Part 1

Chapter 4 introduces protocols as essential rules for communication in both human and computer contexts, emphasizing their role in ensuring effective data transmission in networks. It discusses various flow control techniques, error control mechanisms, and the OSI model's layered architecture, detailing how data is managed and transmitted across different layers. The chapter highlights the importance of protocols in maintaining reliable communication and addresses common methods for error detection and correction.

Uploaded by

eyibeltal3939
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 102

Chapt

er 4
Introduction to
Protocol
Compiled By: Atinkut M. and
Dawed O.

1
Protocol
 Protocols are rules and procedures for communicating.

 The term "protocol" is used in a variety of contexts.

 Rules of protocol apply in the same way in the computer


environment.
 When several computers are networked, the rules and technical
procedures governing their communication and interaction are
called protocols.
 For example, diplomats from one country adhere to rules of
protocol designed to help them interact smoothly with diplomats
from other countries.
2
 Protocols
Cont.…
are necessary to ensure effective
communication
between two computers on a network.
 For example, hardware problems and/or noise can sometimes lead
to corrupted or lost bits or packets, duplicated packets, or out of
order packets.
 Protocols are responsible for adding extra information to packets
to make sure communication occurs without such loss or
duplication.
 They may add parity bits, checksum or CRC information to detect
transmission errors, or add sequencing information to make sure
3
packets are received in the correct order.
Cont..
 When talking about protocols, the term

 Completely reliable delivery means every packet is


that
guaranteed to reach its destination without errors.
 Protocols that do not provide completely reliable delivery
are called best effort delivery schemes.
 Best effort delivery schemes simply try their best to
deliver a packet without errors, but do not guarantee anything.

4
Flow control
 Flow control refers to techniques used to regulate the flow of
data from a source transmitter to a destination receiver.
 Sometimes the source may transmit data at a faster rate than
the destination can process it, and data will be lost.
 Flow control addresses this problem.

I. Stop-and-wait flow control

II. Sliding window flow control

5
I. Stop-and-wait flow control
 The simplest form of flow control is called stop-and-wait flow
control.
 Whenever the sending computer sends a message over the
network, it starts a timer.
 If no acknowledgement is received from the receiving computer
before a certain amount of time has expired it will assume that
the packet was lost, and it will retransmit it.
 Otherwise, when the acknowledgement is received it will
proceed to transmit the next packet.
6
Cont.….

Figure 1– Stop-and-wait flow control 7


II. Sliding window flow control
 The stop and wait flow control technique provides completely
reliable delivery, and works well if the data to be transmitted
consists of a small number of large packets.
 However, in computer networks data is almost always
transmitted in a large number of small packets.
 In this case, stop-and-wait flow control causes the sender to
spend a lot of time waiting for acknowledgements to arrive.
 A more efficient technique is called sliding window
flow
control, and is illustrated in Figure 2.
8
Cont..

Figure 2 – Sliding window flow control (at the sender)

 Using sliding window flow control the receiving computer


first establishes a buffer (a block of memory to store received
packets). It informs the sending computer of the size of the
buffer (for example 4 packets), and tells it that it is ready to
receive data. 9
Cont.…
 The sending computer then transmits packets for all
available space in the buffer, without waiting for
acknowledgements.
 Only when the buffer is full does it wait to receive an
acknowledgement.
 The receiver will remove packets from the buffer and
process them.
 It will send an acknowledgement after it has
processed
each packet. 10
Cont…
 Whenever the sender receives an acknowledgement it knows
that there is some space in the buffer, so it can transmit another
packet.
 This can be visualised as a window sliding along the data that
needs to be sent.
 The size of the window is the same as the size of the buffer. If
a packet is inside the window it can be transmitted; if it is to
the right is has been sent already; if it is to the left it is still
unsent.
11
The efficiency improvements achieved by using sliding window flow control.
 Stop and wait flow control is only really useful when the data to be
transmitted consists of a small number of large packets, which is not
normally the case.
 For high-speed networks, sliding window flow control is essential.
figure 3 – Comparison of flow control techniques

12
Error control
 Error control refers to mechanisms that detect and correct errors
that occur in transmission.
 The most common techniques for error control are based on the
following ingredients:
 Error detection
 Positive acknowledgement: The destination returns a positive
acknowledgement message if a packet is successfully received
and error-free.
 Retransmission after timeout: The source retransmits a packet that
has not been acknowledged after a predetermined amount of
time.
 Negative acknowledgement and retransmission: The destination
returns a negative acknowledgment to packets in which an error is
detected. The source retransmits such packets.
13
Cont.…
 Collectively these mechanisms are all referred to as automatic
repeat request (ARQ).
 The effect of ARQ is to turn an unreliable data link
into a reliable one.
ARQ provides completely reliable delivery of packets.

Three versions of ARQ have been standardised:

I. Stop-and-wait ARQ

II. Go-back-N ARQ

III. Selective reject ARQ


14
I. Stop-and-wait ARQ
 Stop-and-wait ARQ (see Figure 4) is based on the stop-and-
wait flow control technique described above.
 The source transmits a single packet, starts a transmission
timer, and then waits for an acknowledgment (ACK) to arrive.
 It will not send any other data until it receives the ACK packet
from the destination.
 If the timer reaches a certain predetermined value (the timeout
interval) the source will retransmit the packet and restart the
timer.

15
Cont.…
 Two types of error could occur in this technique.

 First, the data packet itself could be lost or corrupted.

 If the data packet is corrupted the destination will detect the error
using an error detection technique and discard the corrupted
packet.
 Whether the packet was lost or corrupted, after the
timeout interval the source will retransmit.
 Second, the destination could successfully receive the data packet,
but the ACK could be lost or corrupted.
 In this case no acknowledgment will be received before
the 16
timeout interval so the packet will be retransmitted.
II. Go-back-N ARQ
 This form of error control is based on the sliding window
flow
control technique.
 The source will send a number of frames without waiting
for acknowledgements from the destination.
 The number it sends is determined by the size of the
destinations buffer.
 The destination will send positive acknowledgements (RR = Receive
Ready) for successfully received packets.
 These positive acknowledgements are cumulative, i.e.
an
3.
acknowledgement for packet 4 implicitly acknowledges packets 1 17
to
Cont.…
 If the destination detects an error, it discards the packet and waits
for further packets to arrive.
 If the destination receives an out-of-order packet it will send a
negative acknowledgement (REJ = Reject) back to the source
telling it the number of the next packet it expects to receive.
 The source will then retransmit this packet together with all
subsequent packets that have been transmitted.
 This technique is called go-back-N because when an error occurs
the sender has to go back a number of packets and retransmit them
all.
 Figure 4 illustrates the go-back-N error control technique.
18
III. Selective-reject ARQ
 Selective-reject ARQ is similar to go-back-N ARQ.

 However, with selective-reject-ARQ, the only packets that are


ever retransmitted are those for which a negative
acknowledgement (SREJ = Selective Reject) is received.
 Figure 4 illustrates this scheme.

 After the lost packet has been retransmitted the source resumes
transmission where it left off.

19
Cont.….
 Selective-reject-ARQ would appear to be more efficient than
go-back-N ARQ but in fact it is less common.
 The reason for this is that the destination must maintain a
larger buffer in order to be able to insert retransmitted packets
in their correct location.
 Also, both source and destination require more
complex
processing to make the scheme work.

20
Comparison of error control techniques

21
Figure 4 – Comparison of error control techniques
Network Models
 In Complex systems are better described with layered structure.

 Some of the benefits of layering networking protocol


specifications
include:
 Data hiding and encapsulation – data structures, algorithms, etc.
in a layer are not visible to other layers. The addition of control
information to data is called encapsulation.
 Decomposition – complex systems can be decomposed into
more easily manageable pieces.
 System can evolve since layers can be changed (as long as
service and interface does not change)
 Alternate services can be offered at layer N+1 that share
the
services of layer N.
and capabilities. 22
Cont.…

 The messages exchanged between network entities are


called protocol data units (PDUs)
 PDU at layer n is called n-PDU

 Layer-n protocol defines contents and format of an n-PDU as


well as the manner in which the n-PDUs are exchanged
 Protocols of the various layers, taken together, are
called protocol stack

23
Cont.…

 In a computer network, each layer may perform one or more of the


following tasks:
 Error control

 Flow control

 Segmentation and reassembly

 Multiplexing

 Connection setup

 Routing

24
Cont.…
 Two Network Models:
 OSI and

 TCP/IP

 OSI (Open System Interconnect) consists of 7 layers:

 Application Set (Application, Presentation and Session)

 Transport Set (Transport , Network, Data link and Physical)

25
OSI model

 The OSI model is divided into two layers: upper layers and
lower layers.
 The upper layer of the OSI model mainly deals with the
application related issues, and they are implemented only in the
software.
 The application layer is closest to the end user.

 Both the end user and the application layer interact with
the software applications.
 An upper layer refers to the layer just above another layer.
26
OSI model Cont…..

 The lower layer of the OSI model deals with the data
transport
issues.
 The data link layer and the physical layer are implemented
in
hardware and software.
 The physical layer is the lowest layer of the OSI model
and is
closest to the physical medium.
 The physical layer is mainly responsible for placing
27
the information on the physical medium.
The OSI reference model Cont…

 Network software operates at many different levels within the


sending and receiving computers.
 Each of these levels, or tasks, is governed by one or
more protocols.
 These protocols, or rules of behaviour, are
standard specifications for formatting and moving the data.

28
The OSI reference model Cont…

 When the sending and receiving computers follow the


same
protocols, communication is assured.

 For example, a protocol that is responsible for sending an


email from one mail server to another is very different from a
protocol that is responsible for transmitting the binary 1s and
0s onto the network cabling.

29
OSI - a layered architecture

 The OSI reference model architecture divides network


communication into seven layers. Each layer covers different
network activities, equipment, or protocols.
 Layering specifies different functions and services as data moves
from one computer through the network cabling to another
computer.
 The OSI reference model defines how each layer communicates
and works with the layers immediately above and below it.
 For example, the session layer communicates and works with the
presentation and transport layers. 30
The 7 layers of the OSI reference model

 Each layer provides some service or action that prepares the


data for delivery over the network to another computer.

31
Cont.…
 The lowest layers (1 and 2) define the network's physical media and
related tasks, such as putting data bits onto the NICs and cable.
 The highest layers define how applications access communication
services.
 The higher the layer, the more complex is its task.

 The layers are separated from each other by boundaries


called
interfaces.
 All requests are passed from one layer, through the interface, to the
next layer.
 Each layer builds upon the standards and activities of the
Cont.…
.

33
Relationships among OSI reference model layers
 Each layer provides services to the next-higher layer and shields
the upper layer from the details of how the services below it are
actually implemented.
 At the same time, each layer appears to be in direct
communication with its associated layer on the other computer.
 This provides a logical, or virtual, communication between the
same layers on the two computers.
 In reality, actual communication between adjacent layers
takes
place on one computer only, and actual communication between
computers occurs at the physical layer only. 34
Cont.….
 At each layer, software implements network functions according
to a set of protocols.
 Before data is passed from one layer to another, it is
broken
down into packets.
 At each OSI layer, adds additional formatting or addressing to
the packet, which is needed for the packet to be successfully
transmitted across the network.
 At the receiving end, the packet passes through the layers in
reverse order.
 A software module at each layer reads the information on the
35
packet, strips it away, and passes the packet up to the next layer.
Cont..
 When the packet is finally passed up to the application layer,
the addressing information has been stripped away and the
packet is in its original form, which is readable by the receiver.

Figure:-Communication between computers using the OSI reference model 36


Cont.…
 With the exception of the lowest layer in the OSI networking
model (i.e. the physical layer), no layer can pass information
directly to its counterpart on another computer.
 Instead, information on the sending computer must be passed
down through each successive layer until it reaches the physical
layer.
 The information then moves across the networking cable to the
receiving computer and up that computer's networking layers
until it arrives at the corresponding layer.

37
Cont.…

 For example, when the network layer sends information from

computer A, the information moves down through the data-

link and physical layers on the sending side, over the cable,

and up the physical and data-link layers on the receiving side

to its final destination at the network layer on computer B.

38
Layer-7: Application layer

 It is the top most layer of OSI Model.

 Enables the user to access the network

 It provides user interfaces and supports for services

 This layer relates to the services that support


directly user

applications, such as software for file and transfers,

access database access, e-mail and network


39
management.
Functions of Application Layer

 Mail Services: This application provides e-mail


various services.

 File transfer & Access: It allows


users to access files in a remote host, to retrieve
files from remote computer for use etc.

 Remote log-in: A user can log into a


remote computer and access the resources of that
computer.

 Accessing the World Wide Web: Most common application


40
today is the access of the World Wide Web.
Layer-6: Presentation layer
 A Presentation layer is mainly concerned with the syntax and
semantics of the information exchanged between the two
systems.
 It acts as a data translator for a network.

 This layer is a part of the operating system that converts the


data from one presentation format to another format.
 The Presentation layer is also known as the syntax layer.

 Providing services for secure efficient data transmission


 e.g. data encryption, and data compression.
41
Functions of Presentation Layer
 Data Presentation or Translation:

 The processes in two systems exchange the information in the


form of character strings, numbers and so on.
 Because different computers use different encoding systems.

 It ensures that the data being sent is in the format that the
recipient can process.
 It converts the data from sender-dependent format into a
common format and changes the common format into receiver-
dependent format at the receiving end.
42
Functions of Presentation Layer

 Data Encryption: PL provides this facility by which hides the


information from everyone except the person who originally
sent the information & the intended recipient. When encrypted
data arrives at destination, PL decrypts the message.
 Data Compression: PL shrinks large amount of data
into
smaller pieces i.e. it reduces the size of data.

43
Layer-5:Session layer
 This layer allows two applications on different computers
to open, use, and close a connection called a session.
 The Session layer is used to establish, maintain
and synchronizes the interaction between communicating
devices.
 It also provides for orderly communication between devices by
regulating the flow of data.
 Regulates which side transmits, plus when and how long it transmits.

 The session layer is responsible for managing this dialog


and handles such things as login requests and password 44
Functions of Session Layer
 Establishing, Maintaining and ending a session:

 When sending device first contact with receiving device, it


sends syn (synchronization) packet to establish a connection &
determines the order in which information will be sent.
Receiver sends ack (acknowledgement). So the session can be
set & end.
 Dialog Control:

 This function determines that which device will communicate


first and the amount of data that will be sent.
45
Functions of Session Layer

 Synchronization:

 Session layer adds some checkpoints when transmitting the

data in a sequence. If some error occurs in the middle of the

transmission of data, then the transmission will take place

again from the checkpoint. This process is known as

Synchronization and recovery.

46
Layer-4:Transport layer
 The transport layer ensures that packets are delivered error free, in
sequence, and without losses or duplications.
 The main responsibility of the transport layer is to transfer the data
completely.
 At the receiver side, transport layer provides services to application
layer & takes services form network layer.
 At the source side, transport layer receives message from upper
layer into packets and reassembles these packets again into
message at the destination.
 It is not concerned with the route the data takes to reach
47
its
destination.
The two protocols used in Transport layer
 Transmission Control Protocol
 It is a standard protocol that allows the
systems to
communicate over the internet.
 It establishes and maintains a connection between hosts.
 When data is sent over the TCP connection, then the TCP
protocol divides the data into smaller units known as segments.
Each segment travels over the internet using multiple routes,
and they arrive in different orders at the destination. The
transmission control protocol reorders the packets in the
correct order at the receiving end.
 In this type of transmission the receiving devices sends an
acknowledge back to the source after a packet or group of
packet is received.
48
 It is slower transmission method.
The two protocols used in Transport layer

 User Datagram Protocol


 User Datagram Protocol is a transport layer protocol.

 It is an unreliable transport protocol as in this case receiver


does not send any acknowledgment when the packet is
received, the sender does not wait for any acknowledgment.
Therefore, this makes a protocol unreliable.
 It is faster transmission method.

49
Functions of Transport Layer
 Segmentation of Message into packet & reassembly of packets
into message.
 When the transport layer receives the message from the upper
layer, it divides the message into multiple segments, and each
segment is assigned with a sequence number that uniquely
identifies each segment. When the message has arrived at the
destination, then the transport layer reassembles the message
based on their sequence numbers.
 Flow Control: Flow control facility prevents the source
form
sending data packets faster than the destination can handle. 50
Functions of Transport Layer
 Error control: TL ensures that the entire message arrives at the
receiving TL without error.

 Connection control: Transport layer provides two services


Connection-oriented service and connectionless service. A
connectionless service treats each segment as an individual
packet, and they all travel in different routes to reach the
destination. A connection-oriented service makes a connection
with the transport layer at the destination machine before
delivering the packets. In connection-oriented service, all the
packets travel in the single route. 51
Layer-3: Network layer
 The network layer is responsible for addressing messages and
translating logical addresses and names into physical
addresses.
 It is responsible for the source to destination delivery of a
packet across multiple networks.
 It determines the best path to move data from source to the
destination based on the network conditions, the priority of
service, and other factors.

52
Layer-3: Network layer

 If two systems are attached to different networks with devices


like routers, then N/W layer is used.
 Routers are the layer 3 devices, they are specified in this layer
and used to provide the routing services within an
internetwork
 Thus DLL overseas the delivery of the packet between the two
systems on same network and the network layer ensures that
the packet gets its point of origin to its final destination.

53
Functions of Network Layer
 Internetworking: An internetworking is the main responsibility
of the network layer. It provides a logical connection between
different devices.
 Addressing: A Network layer adds the source and destination
address to the header of the frame. Addressing is used to identify
the device on the internet.
 Network addresses are assigned to local devices by network
administrator and assigned dynamically by special server
called DHCP (Dynamic Host Configuration Protocol)

54
Functions of Network Layer

 Routing: Routing is the major component of the


network

layer, and it determines the best optimal path out of


the

multiple paths from source to the destination.

 Packetizing: A Network Layer receives the packets from the

upper layer and converts them into packets. This process is

known as Packetizing. It is achieved by internet protocol (IP).


55
Layer-2: Data-link layer

 This layer controls the electrical impulses that enter and leave the

network cable, and is responsible for controlling the flow of data

from sender to receiver.

 Packages raw bits from the Physical layer into frames

(logical, structured packets for data).

 It receives the data from network layer and creates FRAMES ,

add physical address to these frames & pas them to physical layer.
56
Layer-2: Data-link layer

 Provides reliable transmission of frames

 It waits for an from the


receiving
acknowledgment computer.

 Retransmits frames for which acknowledgement


not

received

57
Data-link layer 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.
 Establishes and maintains links between communicating devices.

 It is used for transferring the packets over the network. 58


Functions of Data Link Layer
 Framing :Data link layer divides the bits received from network
layer into frames. (Frame contains all the addressing information
necessary to travel from S to D).
 Physical addressing: After creating frames, data link layer adds
physical address of sender/receiver (MAC address) in the header
of each frame.
 Flow Control: It is the technique through which the constant data
rate is maintained on both the sides so that no data get corrupted.
Data link layer prevents the fast sender from drowning the slow
receiver. 59
Functions of Data Link Layer
 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 occurr, 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. 60
Layer-1: Physical layer
 It is the lowest layer of the OSI model.

 It is responsible for the actual physical connection between the


devices. Such physical connection may be made by using twisted
pair cable.
 Transmit the individual bits from one computer to another.

 This layer transmits the unstructured, raw bit stream


over a physical medium (such as the network cable).
 The physical layer is totally hardware-oriented and deals with all
aspects of establishing and maintaining a physical link
between
communicating computers. 61
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 full-duplex 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.
62
Summary of OSI Layers

63
TCP/IP Model
 The TCP/IP protocol suite was
• Troubleshooting,
Application
developed prior to the OSI model. file sharing, internet

 Therefore, the layers in


the • Flow control, error
TCP/IP protocol Transport
control
do
suite
not
• IP addressing and
match exactly with those in Internet routing of
network traffic
the OSI model.
 The original TCP/IP protocol Network • Interface with the
Access physical network
suite was defined as four layers.
Today, however, TCP/IP is 64
Comparison between OSI and TCP/IP

OSI Model TCP/IP Model

Application

Presentation Application
Session

Transpor Transport
t Internet
Network

Data Link Network Access


Physical

65
TCP/IP consists of 5 layers
PDU=The unit of communication at each Layer

Layer Stack PDU Purpose


#
Layer 5 Applicatio Messag Supports network applications. It includes many
n e protocols: HTTP, SMTP and FTP to support file
transfer.
Layer 4 Transport Segmen Responsible for transporting application-layer
t messages between the client and server sides of an
application. In the Internet, there are two
transport protocols, TCP and UDP.
Layer 3 Network Datagra Responsible for routing datagrams from one host to
m another. Two principal components: IP protocol
and routing protocols.
Layer 2 [Data] Frame Services depend on the specific link-layer protocol
Link used over a link. For example, reliable or not reliable.
Ethernet and PPP are examples of link-layer
protocol.
Layer 1 Physical 1-PDU Moves individual bits within the frame from one node
[bit] to the next. 66
Overview of TCP/IP
 TCP/IP consists of a number of different protocols that
perform a variety of functions and operate at a number of
different levels.
OSI Layer TCP/IP Protocols

7=Application Telnet DHCP

6=Presentation FTP SNMP

5=Session SMTP DNS

4=Transport TCP UDP

3=Network IP ARP
RARP
2=Datalink Hardware oriented

1=Physical Hardware oriented


67
Cont.

• 1

68
Chapter 4

Part 2
The TCP/IP protocols

69
The TCP/IP protocols
The IP protocol and IP addresses
 One of the most important protocols in the TCP/IP suite is the IP
protocol.
 This is used at the Internet layer of TCP/IP (i.e. the Network
layer in the OSI model) and is used to attach network addresses
to packets.
 The IP protocol provides best effort delivery between network
stations.
 IP routes packets on the network by using IP addresses.

70
Cont.…
 An IP address consists of 4 numbers between 0 and
255
separated by dots.
 For example, 146.23.0.194 is a valid IP address.

 When you surf the Internet and type a URL into your browser
(e.g. www.yahoo.com) you are actually using IP addresses.
 Every Internet domain such as Yahoo or Google has at least
one IP address on the Internet.

71
Cont.…
 An IP (Internet Protocol) address is a unique identifier
for a
node or host connection on an IP network.
 An IP address is a 32 bit binary number usually represented as 4

decimal values, each representing 8 bits, in the range 0 to 255


(known as octets) separated by decimal points.
 This is known as "dotted decimal" notation.
Example: 140.179.220.200
 It is sometimes useful to view the values in their binary form.
 10001100.10110011.11011100.11001000 72
Cont.…
 Every IP address consists of two parts,

 One identifying the network and

 The other identifying the node.

 The Class of the address and the subnet mask determine which

part belongs to the network address and which part belongs to

the node address.

73
The Original Classful Addressing Scheme

• There are 5 different address classes. You can determine


which class any IP address is in by examining the first 4 bits of
the IP address.
– Class A addresses begin with 0xxx, or 1 to 126 decimal.

– Class B addresses begin with 10xx, or 128 to 191 decimal.

– Class C addresses begin with 110x, or 192 to 223 decimal.

– Class D addresses begin with 1110, or 224 to 239 decimal.

– Class E addresses begin with 1111, or 240 to 254 decimal.

74
The Five Network Classes
1. Class A – begins with 0
• 00000001 (110) to 01111111 (12610)*

2. Class B – begins with 10


• 10000000 (12810) to 10111111 (19110)

3. Class C – begins with 110


• 11000000 (19210) to 11011111 (22310)
*01111111 = 12710
Addresses beginning with 127 are reserved
loopback (127.0.0.1 is YOU) 75
for
The Five Network Classes
4. Class D – begins with 1110
• 22410 to 23910
• Reserved for multicasting

5. Class E – begins with 1111


• 24010 to 25410
• Reserved for future use

These should not be used for host


addressing 76
Cont..
.

77
IP Addresses *
Class 1st Octet Networks Ids Host IDs

A 1-126 27 = 126 224 = 16M

B 128-191 214 = 16K 216 = 64K

C 192-223 221 = 2M 28 = 255

*Numbers not exact


78
Cont.…

Maximum Maximum
Network
Prefix bits number Suffix bits
class computers
of
networks per
network
A 7 128 24 16777216
B 14 16384 16 65536
C 21 2097152 8 256
 E.g. given the IP address 128.255.10.1, we know immediately that this is
on a class B network. Because if we rewrite the address in binary form
(10000000.11111111.00001010.00000001), the first two bits are 10,
which always indicate a class B network. So the first 16 bits represent the
network ID (128.255) and the last 16 bits are the computer ID (10.1).
79
Exercise
 For example, using the class-based system of IP
addressing, what can you deduce from the following IP
addresses?
 i.e. What class network are they on, and what are the
network ID and computer ID?

I. 223.1.0.129

II. 2.255.15.254

III. 131.192.161.1
80
Reserved IP addresses
 You cannot use every IP address. There are some addresses, or sets of
addresses, that are reserved for special uses. The table below summarises
these.
Network ID Computer Description Use
ID
All 0’s All 0’s This computer Used during system
boot
All 0’s Computer ID A computer on
this subnet
Network ID All 0’s Network number Used to refer to
an entire
subnet
All 1’s All 1’s Limited broadcast Broadcasts message
to all computers on
this
subnet
Network ID All 1’s Directed Broadcasts message to
broadcast all computers on
specified network
Reserved IP addresses……
 We can see that any IP address that has a valid network ID, but all
binary 0‟s for the computer ID, is the network number.
 The network number is a way of referring to an entire subnet.
 Therefore this address cannot be assigned to a computer.
 Similarly if the computer ID is all binary 1‟s it is a broadcast
address.
 The broadcast address is used if you want to send a packet to
every computer on a subnet.
 Therefore this address can also not be assigned to a computer on
the network.
82
Reserved IP addresses
 For example, a class C network provides 256 different values for the
computer ID, but only 254 of these can be assigned to computers.
 Most subnets have at least one router.

 If it didn‟t have a router it would be isolated and could not


communicate with any other networks.
 A router must also have an IP address on the subnet, and by convention
the first IP address after the network number is assigned to the default
router.
 Note that this is not a rule, just a convention (it is usually done but you
do not have to do it).
83
Non-routable IP addresses
 In addition to these there are a number of ranges of IP
addresses that are specified as „non-routable‟ addresses.
 This means that routers on the Internet will never forward them.

 This is because they are reserved for local network use.

 If every computer in the world that was on a network connected


to the Internet had to have a unique IP address we would have
run out of IP addresses many years ago.
 But many of these computers are on networks that only connect to
the Internet through a single router, gateway computer or dial-up
connection. 84
Non-routable IP addresses…..
 Therefore, on networks like this we only need a single routable IP
address; the rest of the computers can be given non-routable
addresses.
 A number of computers on networks in different parts of the world
can share the same non-routable IP address provided they are not
directly connected on the same network.
 Internet routers are programmed to ignore these addresses so there
can be no address conflict.

85
There are three IP network addresses
reserved for private networks

1. 10.0.0.0/8

2. 172.16.0.0/12

3. 192.168.0.0/16
 These can be used by anyone setting up an internal
network.
 Routers will never forward packets coming from these
addresses.

86
Exercise
Which of the following IP addresses are invalid addresses for
computers on the Internet? If they are invalid, explain why.
A.130.22.256.22
B.222.222.255.222
C.240.12.3.24
D.128.128.0.128
E.200.128.0.255
F.255.255.255.255
G.127.0.0.1
H.13.13.0.13
I.10.240.12.11
87
Answers
A. This address is invalid as the third number is 256 – the highest possible value is 255.

B. Valid address.

C. This address is invalid as the first number is above 223, so it is reserved and cannot be assigned to
computers.

D. Valid address.

E. This is not a valid address as the last number is 255, which represents the directed broadcast
address, and cannot be assigned to computers.

F. This is not a valid address as it represents the limited broadcast address – it will broadcast to all
computers on the subnet.

G. This is not a valid address as it represents the loopback address and cannot be assigned to
computers. This is used for troubleshooting purposes, and will send a message to the local
computer.

H. Valid address.

I. Not a valid address as this is a non-routable address – it will be ignored by Internet


routers so the
computer will never receive any packets. 88
Classless Inter-domain routing
 When this class-based system was introduced, it was thought
that it would easily provide enough IP addresses for the
Internet.
 However, due to the rapid increase in the number of Internet
users worldwide, IP addresses eventually came to be in
short supply.
 Because of this, in 1994 a new system was introduced:
classless inter-domain routing, or CIDR.
 CIDR uses subnet masks to subdivide networks.
89
Cont.…
 The 32 bits in a subnet mask indicate which of the bits in an IP
address are a part of the prefix (network ID), and which are a
part of the suffix (computer ID).
 If a bit in the subnet mask is a 1, that bit is in the prefix and
so must be fixed in the IP addresses of a subnet.
 If a bit in the subnet mask is a 0 then it is part of the suffix and
it is allowed to vary within a subnet.
 For example, in a class C network only the last 8 bits can vary, so the subnet mask
is 255.255.255.0 (or 11111111.11111111.11111111.00000000). For class A and B
networks the subnets masks are 255.0.0.0 and 255.255.0.0 respectively.
90
Subnetting Examples
 There are three types of Subnetting examples

I. Subnetting when given a required number of networks

II. Subnetting when given a required number of clients

III. Given an IP address & Subnet Mask, finding original


network range (reverse engineering a subnet problem)

91
Subnetting when given a required number of networks
Example 1: A service provider has given you the Class C
network range 209.50.1.0. Your company must break the network
into 20 separate subnets.
Step 1. Determine the number of subnets and convert to binary
 In this example, the binary representation of 20 = 00010100.

Step 2. Reserve required bits in subnet mask and find incremental value
 The binary value of 20 subnets tells us that we need at least 5 network
bits to satisfy this requirement (since you cannot get the number 20 with
any less than 5 bits – 10100)
 Our original subnet mask is 255.255.255.0 (Class C subnet)
 The full binary representation of the subnet mask is as follows:
 255.255.255.0 = 11111111.11111111.11111111.00000000
92
Cont…
 We must “convert” 5 of the client bits (0) to network bits (1) in order
to satisfy the requirements:
 New Mask = 11111111.11111111.11111111.11111000

 If we convert the mask back to decimal, we now have the subnet mask
that
will be used on all the new networks – 255.255.255.248
 Our increment bit is the last possible network bit, converted back to
a binary number:
 New Mask = 11111111.11111111.11111111.1111(1)000 – bit with the
parenthesis is your increment bit.
 If you convert this bit to a decimal number, it becomes the number
“8”
93
Cont…
Step 3) Use increment to find network ranges

 Start with your given network address and add your increment to the

subnetted octet: 209.50.1.0

209.50.1.8

209.50.1.16 …etc

 You can now fill in your end ranges, which is the last possible IP

address before you start the next range. 209.50.1.0 – 209.50.1.7

209.50.1.8 – 209.50.1.15

209.50.1.16 – 209.50.1.23 …etc

 You can then assign these ranges to your networks! Remember the first
and
last address from each range (network / broadcast IP) are unusable. 94
Exercise
 Your company would like to break the Class B
private IP address range 172.16.0.0 into 60
different subnets

95
Subnetting when given a required number of clients
Example 1: A service provider has given you the Class C network
range 209.50.1.0. Your company must break the network into as many
subnets as possible as long as there are at least 50 clients per network.
Step 1. Determine the number of clients and convert to binary
 In this example, the binary representation of 50 = 00110010

Step 2) Reserve required bits in subnet mask and find incremental value
 The binary value of 50 clients tells us that we need at least 6 client bits to
satisfy this requirement (since you cannot get the number 50 with any
less than 6 bits – 110010)
 Our original subnet mask is 255.255.255.0 (Class C subnet)

 The full binary representation of the subnet mask is as


follows: 96
Cont…
 We must ensure 6 of the client bits (0) remain client bits (save the clients!)
in order to satisfy the requirements. All other bits can become network
bits:
 New Mask = 11111111.11111111.11111111.11 000000 note the 6 client
bits that we have saved
 If we convert the mask back to decimal, we now have the subnet mask
that will be used on all the new networks – 255.255.255.192
 Our increment bit is the last possible network bit, converted back to a
binary number:
 New Mask = 11111111.11111111.11111111.1(1)000000

 bit with the parenthesis is your increment bit.

 If you convert this bit to a decimal number, it becomes the number “64”. 97
Cont…
Step 3) Use increment to find network ranges

 Start with your given network address and add your increment to the

subnetted octet: 209.50.1.0


209.50.1.64
209.50.1.128
209.50.1.192
 You can now fill in your end ranges, which is the
last possible IP address
before you start the next 209.50.1.0 – 209.50.1.63
range. 209.50.1.64 – 209.50.1.127
209.50.1.128 –
209.50.1.191
209.50.1.192 –
 You can then assign these ranges to your networks! Remember the first and
209.50.1.255
last address from each range (network / broadcast IP) are unusable.
98
Exercise
 Your company would like to break the Class B
private IP address range 172.16.0.0 into as
many subnets as possible, provided that they
can get at least 300 clients per subnet

99
Given an IP address & Subnet Mask, find original network
range (reverse engineering a subnet problem)
You are given the following IP address and subnet mask:

192.168.1.58

255.255.255.240
 Identify the original range of addresses (the subnet) that this IP address
belongs to
 When reverse engineering a problem, all you need to do is break the
subnet mask back into binary and find the increment that was used
 255.255.255.240 = 11111111.11111111.11111111.11110000

 As before, the last possible network bit is your increment.

 In this case, the increment is 16

 Use this increment to find the network ranges until you pass the given
IP100
Cont.…
192.168.1.0

192.168.1.16

192.168.1.32

192.168.1.48

192.168.1.64 (passed given IP address 192.168.1.58)


 Now, fill in the end ranges to find the answer to the scenario:

192.168.1.0 – 192.168.1.15

192.168.1.16 – 192.168.1.31

192.168.1.32 – 192.168.1.47

192.168.1.48 – 192.168.1.63 (IP address 192.168.1.58 belongs to this


range)
101
10
2
?

You might also like