Unit 5 Complete Notes
Unit 5 Complete Notes
✓ In the world of web and internet, the term "reference model" defined a standard means of
communication architecture which is accepted worldwide.
✓ As users are using the network of a system and are situated over a broad physical range
and even the network devices users are using might have different architecture.
✓ So, for providing a standard communication between these heterogeneous devices, a
standardized model (also termed as a reference model) is necessary for providing us the
way how different devices have to communicate despite their diverse architecture.
✓ For this reason, two models were designed where one is based on hypothetical
communication architecture (OSI model) while the other is based on a fully practical
model (TCP/IP model).
✓ In computer networks, reference models give a conceptual framework that standardizes
communication between heterogeneous networks.
✓ The two popular reference models are −
(i)OSI Model (ii)TCP/IP Protocol Suite
• The OSI reference model is as shown in the figure. There are seven layers in the model.
Physical layer, Data link layer, Network layer, Transport layer, Session layer,
Presentation layer, Application layer.
• Each layer performs unique and specific task and it offers services to the layer above
it. Each computer on a network uses a series of protocols to perform the functions
assigned to each layer.
• At the top of the stack is the application layer and at the bottom is the physical medium
which actually connects the computers to form a network.
• The figure shows the OSI model with two hosts A and B, communicating with each
other.
• Interface: an interface defines the operations and services offered by lower layer to the
upper layer. This is an interface between each pair of adjacent layers as shown in the
figure.
• Peer: the entities comprising the corresponding layers on different machines are called
as peers. The communication actually takes place between the peers using the protocols.
• Exchange of information: at the physical layer the communication is direct that is,
machine A sends a stream of bits to machine B. At higher layers each layer in the
sending machines adds its own information to the message it receives from the layer
just above it and passes the whole package to the layer just below it. The information
added by each layer is in the form of headers or trailers. At layer 1 the entire package
is converted to a form that can be transferred to the receiving machine.
Peer-to-Peer processes:
• The processes on each machine that communicate at a given layer are called peer-to-peer
processes.
•At the physical layer, communication is direct: Device A sends a stream of bits to device B
(through intermediate nodes).
• At higher layers each layer in the sending machines adds its own information to the message
it receives from the layer just above it and passes the whole package to the layer just below it.
Encapsulation
• The outgoing information will travel down through the layers to the lowest layer.
• While moving down on the source machine, it acquires all the control information which is
required to reach the destination machine.
• The control information is in the form of Headers and Trailer which surrounds the data
received from the layer above.
• This process of adding headers and trailers to the data is called as data encapsulation.
• The information added by each layer is in the form of headers or trailers.
• At layer 1 the entire package is converted to a form that can be transferred to the receiving
machine. • At the receiving machine, the message is unwrapped layer by layer, with each
process receiving and removing the data meant for it.
• For example, layer 2 removes the data meant for it, then passes the rest to layer 3.
• Layer 3 then removes the data meant for it and passes the rest to layer 4, and so on.
•The headers and trailers contain control information. The headers and trailers form the
envelope which carries the message to the desired destination.
Example of Data Encapsulation
1. Physical layer:
• It co-ordinates the functions required to transmit bit stream over physical medium.
Functions:
1. Bit synchronization: provides the synchronization of the bits by providing a clock. This
clock controls both sender and receiver thus providing synchronization at bit level.
2. Bit rate control: defines the transmission rate i.e. the number of bits sent per second.
3. Line configuration: defines the way in which the devices are connected to the medium.
Two different line configurations are used (i)point to point configuration and (ii) multipoint
configuration to activate, maintain and deactivate the physical connection.
4. Physical topologies: bus, star or mesh topology.
5. Transmission mode: Simplex, half-duplex and full-duplex.
6. Multiplexing: uses different techniques of multiplexing, in order to improve the channel
efficiency.
DLL is divided into two Sub-Layers • LLC Sub Layer • MAC Sub Layer
Logical Link Control Sub Layer
• It is upper portion of the Data Link layer.
• Performs Flow control and management of connection errors.
• LLC supports three types of connections:
1. Unacknowledged connectionless service: • does not perform reliability checks or
maintain a
connection, very fast, most commonly used
2. Connection oriented service: • once the connection is established, blocks of data can be
transferred between nodes until one of the node terminates the connection.
3. Acknowledged connectionless service: • provides a mechanism through which individual
frames can be acknowledged.
Media Access Control Sub Layer
• This sub layer contains methods to regulate the timing of data signals and eliminate collisions.
• The MAC sub layer determines where one frame of data ends and the next one starts
- frame synchronization.
• There are four means of frame synchronization:
• Time based,
• Character counting,
• Byte stuffing and
• Bit stuffing.
Functions of data link layer:
• Framing: Divides the stream of bits into manageable data units called frames.
• Physical addressing- Adds a header to the frame to define the sender and/or receiver of the
frame.
• Synchronization: When data frames are sent on the link, both machines must be
synchronized in order to transfer to take place.
• Error control: Adds mechanisms to detect and retransmit damaged or lost frames (CRC).
• Access control: Determine which device has control over the link at any given time.
• Link establishment and termination: Establishes and terminates the logical link between two
nodes.
3. Network Layer
• This layer is incharge of packet addressing , converting logical addresses into
physical addresses.
• It is responsible for the source-to-destination delivery of a packet across multiple
networks (links).
• This layer provides switching and routing technologies, creating logical paths, known as
virtual circuits, for transmitting data from node to node.
• Routing and forwarding are functions of this layer, as well as addressing, internetworking,
error handling, congestion control and packet sequencing.
• The packets will use to arrive at their destination, based on factors like traffic and
priorities. The network layer determines that how data transmits between the
network devices.
Functions of the Network layer are as follows:
• Routing: It is responsible for routing packets from the source host to the destination host.
The routes can be based upon static tables that are rarely changed, or they can be automatically
updated depending upon network conditions.
• Logical Addressing: The data link layer assigns the physical address locally. When the data
packets are routed to remote locations, a logical addressing scheme is required to differentiate
between the source system and the destination system. This is provided by the network layer.
• Packetizing: The network layer receives the data from the upper layers and creates its own
packets by encapsulating these packets. The process is known as packetizing. This packetizing
in done by Internet Protocol (IP) that defines its own packet format.
• Fragmentation: Fragmentation means dividing the larger packets into small fragments.
4. Transport Layer : Transport layer (also called end-to-end layer) manages end to end
(source to destination) (process to process) message delivery in a network and also provides
the error checking and hence guarantees that no duplication or errors are occurring in the data
transfers across the network. It makes sure that all the packets of a message arrive intact and
in order.
Transport layer also provides the acknowledgement of the successful data transmission and
retransmits the data if error is found.
• Service Point Addressing: Transport Layer header includes service point address which is
port address. This layer gets the message to the correct process on the computer unlike Network
Layer, which gets each packet to the correct computer.
(a) In this type of transmission the receiving device sends an acknowledgment, back to the
source after a packet or group of packet is received.
(b) This type of transmission is also known as reliable transport method.
(c) Because connection oriented transmission requires more packets be sent across network,
it is considered a slower transmission method.
(d) If the data that is sent has problems, the destination requests the source for retransmission
by acknowledging only packets that have been received and are recognizable.
(e) Once the destination computer receives all of the data necessary to reassemble the packet,
the transport layer assembles the data in the correct sequence and then passes it up, to the
session layer.
Connectionless Transmission
(a) In this type of transmission the receiver does not acknowledge receipt of a packet.
(b) Sending device assumes that packet arrive just fine.
(c) This approach allows for much faster communication between devices.
(d) The trade-off is that connectionless transmission is less reliable than connection oriented.
• Error Control: Error Control is performed end to end in this layer to ensure that the complete
message arrives at the receiving transport layer without any error. Error Correction is done
through retransmission.
5. Session layer : It has the primary responsibility of beginning, maintaining and ending the
communication between two devices, which is called Session. It also provides for orderly
communication between devices by regulating the flow of data.
The session protocol defines the format of the data sent over the connections. Session
layer establish and manages the session between the two users at different ends in a network.
Session layer also manages who can transfer the data in a certain amount of time and for how
long.
The examples of session layers and the interactive logins and file transfer sessions. Session
layer reconnect the session if it disconnects. It also reports and logs and upper layer errors. The
session layer allows session establishment between processes running on different stations.
The dialogue control and token management are responsibility of session layer.
The functions of the Session layer are :
1. Session establishment, maintenance and termination : allows two application processes
on different machines to establish, use and terminate a connection, called a session.
2. Session support : performs the functions that allow these processes to communicate over the
network, performing security, name recognition, logging and so on.
3. Dialog Controller: Dialog control is the function of session layer that determines which
device will communicate first and the amount of data that will be sent.
When a device is contacted first, the session layer is responsible for determining which device
participating in the communication will transmit at a given time as well as controlling the
amount of data that can be sent in a transmission. This is called dialog control. The session
layer allows two systems to start communication with each other in half-duplex or full-duplex.
4. Dialog separation or Synchronization: The session layer is also responsible for adding
checkpoint or markers within the message. This process of inserting markers to the stream of
data is known as dialog separation.
6. Presentation Layer
Presentation Layer is also called Translation layer. The presentation layer presents the data
into a uniform format and masks the difference of data format between two dissimilar systems.
The presentation layer formats the data to be presented to the application layer. It can be
viewed as the translator for the network. This layer may translate data from a format used by
the application layer into a common format at the sending station, and then translate the
common format to a format known to the application layer at the receiving station.
7. Application Layer : Application layer interacts with application programs and is the highest
level of OSI model.
• Application layer contains management functions to support distributed applications.
• Examples of application layer are applications such as:File Transfer, Electronic Mail,
Remote Login Etc.
Functions of Application layer:
1. Network virtual terminal 2. File transfer access and management 3. Mail services and
directory services.
Horizontal communication
Bit stuffing:
Bit stuffing is the process of adding one extra 0 whenever five consecutive 1‟s in the data, so that the
receiver does not mistake the pattern 0111110 or a flag.
At sender side the bit is stuffed and at receiver side stuffed bit is removed.
As shown in following
Example: Sequence 011111111000 becomes 0111110111000. This extra bit is inserted regardless of
sixth bit 0 or 1.
1) The horizontal communication is the logical connection between the layers, there is no direct
communication between them.
2) Information included in each protocol header by the transmitting system is a message that will be
carried to the same protocol in the destination system.
3) For two computers to communicate over a n/w, the protocol used at each layer of the OSI model in
the transmitting system must be duplicated at the receiving system.
4) The packet travels up through the protocol stack and each successive header is stripped of by the
appropriate protocol & processed.
5) When the packet arrived at its destination, the process by which the headers are applied at the
source is repeated in server.
Fig: Vertical communication in OSI model
1) In addition to communicating horizontally with the same protocol in the other system, the header
information also enables each layer to communicate with the layer above & below it.
2) Eg. The network layer will communicate with the data link layer & transport layer.
3) This interlayer communication is called communication vertical.
4) When a system receives a packet & passes it up through various layers the data link layer protocol
header includes a field which specifies the name of network layer protocol to be used to process the
packet. 5) The network layer protocol header will specify the name of transport layer protocol to be
used to process the packet.
ARP sends the IP broadcast message to all the computer on the network.
The computer whose IP address matches the broadcast IP address sends a reply and along
with, its physical address to the broadcasting computer.
All other computers ignore the broadcast message.
Address Translation with ARP
Example:
ARP request: Argon broadcasts an ARP request to all stations on the network: “What is the
hardware address of Router137?”
ARP Reply: Router137 responds with an ARP Reply which contains the hardware address
Functions of the IP
1. Addressing:
◼ In order to perform the job of delivering datagrams, IP must know where to
deliver them to. For this reason, IP includes a mechanism for host addressing.
2. Data Encapsulation and Formatting/ Packaging:
◼ IP accepts data from the transport layer protocols UDP and TCP.
◼ It then encapsulates this data into an IP datagram using a special format prior
to transmission.
3. Fragmentation and Reassembly:
◼ IP fragment IP datagrams into pieces.
◼ The receiving device uses the reassembly function to recreate the whole IP
datagram again.
4. Routing / Indirect Delivery:
◼ When an IP datagram must be sent to a destination on the same local
network, this is done using direct delivery.
◼ However, if the final destination is on a distant network not directly attached to
the source datagram must be delivered indirectly.
4. ICMP (Internet control message protocol.)
• ICMP is a error reporting protocol.
• This protocol is responsible for providing diagnostic functions and reporting errors due to
the unsuccessful delivery of IP packets.
• It is used by network devices, like routers, to send error messages indicating, for example,
that a requested service is not available or that a host or router could not be reached.
• ICMP can also be used to relay query messages.
• ICMP enables the detection and reporting of problems in the Internet.
5. (Internet Group Management Protocol)
• It Is Responsible For The Management Of IP Multicast Groups.
• It Is Used By Hosts And Adjacent Routers On Ipv4 Networks To Establish Multicast
Group Memberships.
• IGMP Is An Integral Part Of IP Multicast.
• 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.
• IGMP Is Used On Ipv4 Networks.
➢ TCP is Reliable-
Reliable means that every transmission of data is acknowledged by the receiver.
Reliable does not mean that things don't go wrong, it means that we find out when
things go wrong.
If the sender does not receive acknowledgement within a specified amount of time, the
sender retransmits the data.
➢ Stream delivery service:
◼ TCP is a stream oriented protocol.
◼ It allows the sending and receiving process to obtain as a stream of bytes.
◼ TCP creates a working environment in such a way that the sending and
receiving processes seem to be connected by an imaginary “tube” This is
called as stream delivery service.
➢ TCP : Flow Control
◼ Sending and receiving buffers:
◼ The sending and receiving process may not produce and receive data at the
same speed.
◼ Hence TCP needs buffers for storage.
◼ There are two types of buffers used in each direction:
1) Sending buffer
2) Receiving buffer
➢ Full duplex service:
◼ TCP offers full duplex service where the data can flow in both the direction
simultaneously.
◼ The TCP segments are sent both the directions.
2. UDP
UDP is user datagram protocol.
It is connectionless protocol because data is sent without establishing a connection
between sender and receiver before sending the data.
UDP is unreliable because data is delivered without acknowledgement.
UDP does not perform Auto retransmission.
UDP does not use flow control .
UDP has high transmission speed.
UDP Datagram Format
TCP vs UDP
Describe Application Layer Protocols(SMTP, FTP, TELNET & DNS)
SMTP
SMTP is simple mail transfer protocol.
It is connection oriented text based protocol.
Sender communicates with receiver using a command and supplying data over
reliable TCP connection.
SMTP is standard application layer protocol for delivery of email over TCP/IP
network.
SMTP establish a TCP connection between sender and port number 25 of receiver.
Electronic Mail
Data Connection:
◼ Data connection uses the port 20 at the site.
◼ This connection is opened when data to be transferred is ready and it is
closed when transfer of data is over.
◼ The service types used by IP is maximize throughput.
Explanation: 1. File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for
copying a file from one host to another. Figure shows the basic model of FTP.
2. The client has three components: user interface, client control process, and the client data transfer
process. The server has two components: the server control process and the server data transfer
process.
3. The control connection is made between the control processes. The data connection is made
between the data transfer processes.
4. The control connection remains connected during the entire interactive FTP session.
5. The data connection is opened and then closed for each file transferred. It opens each time
commands that involve transferring files are used, and it closes when the file is transferred. In other
words, when a user starts an FTP session, the control connection opens. While the control connection
is open, the data connection can be opened and closed multiple times if several files are transferred.
6. Separation of commands and data transfer makes FTP more efficient. FTP uses the services of
TCP. It needs two TCP connections.
7. FTP uses two well-known TCP ports: Port 21 and Port 20.
TELNET
TELNET is a protocol that allows you to connect to remote computers (called hosts) over a TCP/IP
network (such as the Internet). Using telnet client software on your computer, you can make a
connection to a telnet server (i.e., the remote host)
1. TELNET is a specialized service that lets you use one computer to access the contents of another
computer a telnet host.
2. A telnet program creates a “Window” into the host so you can access files, issue commands, and
exchange data.
3. Telnet is widely used by libraries to allow visitors to look up information, find articles and so on
4. Telnet allows a user who login on any other computer on the network. 5. Telnet sends data in clear
text.
Domain Name Space.
1. A domain namespace is a name service provided by the Internet for Transmission Control Protocol
networks/Internet Protocol (TCP/IP).
2. DNS is broken up into domains, a logical organization of computers that exist in a larger network.
3. The DNS database hierarchical naming scheme is called a domain name space.
4. Each node in the hierarchy represents a partition of the DNS database.
5. The nodes are known as domains, and each of them must have a name as the DNS database is
indexed by name. When you add domains to the hierarchy, the name of the parent domain is
appended to the domain, which becomes a child domain or subdomain.
6. The hierarchical structure of the domain name space consists of a root domain, top-level domains,
second level domains, subdomains, and host names.
• The Root Domain is at the top of the hierarchy and is represented by a period (.).
• Top-Level Domains are two or three-character name codes, representing organisation type
or geographic location, eg: .com, .gov, .edu, .uk, .es etc. Toplevel domains can contain
second-level domains and host names.
• Second-Level Domains are registered to individuals and organisations for use on the
Internet. A second-level name has two name components: a toplevel name and a unique
second-level name, eg: coatbank.com.
• Subdomains are created when organisations extend their DNS tree to represent departments,
divisions, or other geographic locations. Subdomains have three name components: a top-
level name, a unique second-level name, and a unique name representing the department or
location, eg: admin.coatbank.com.
7. Below is an example of the hierarchy of domain naming on the Internet
33
8. In the above example, all websites are broken into regional sections based on the TLD (top-level
domain). In the example of http://support.computerhope.com it has a ".com" TLD, with
"computerhope" as its second level domain that is local to the .com TLD, and "support" as its
subdomain, which is determined by its server.
34
8)The protocol are better hidden and can 8)It is not easy to replace the protocols
be easily replaced as the technology
changes
9)OSI truly is a general model 9)TCP/IP cannot be used for any other
application
10)It has a problem of protocol 10) The model does not fit any protocol
filtering into a model stack.
Version: This field identifies the version of IP, which contains a value 4, which indicates IP version
4. It may contain 6 for IPv6
Header length (HLEN): This indicates the size of the header in a multiple of 4 byte words. When
the header size is 20 bytes, HLEN = 5, and HLEN = 15 when maximum size (60 bytes).
Service Type (Type of Service): This field is used to define service parameters such as the priority
of the datagram and the level of reliability desired.
Total Length: This field contains the total length of the IP datagram. IP datagram cannot be more
than 65,536 since this filed size is 2 bytes or 16 (216 = 65,536).
Identification: This field is used in the situations when a datagram is fragmented. The sub datagram
are sequenced using identification field so that later it can be used to reconstruct the original
35
datagram.
Flags: This field corresponds to identification field. It indicates whether a datagram can be
fragmented and if fragmented, the position of the fragment (first, last or middle).
Fragmentation Offset: If a datagram is fragmented, this field indicates the offset of the data in the
original datagram before segmentation. This is used while reconstructing.
Time to Live (TTL): This filed is initialized by some value and decremented each time it passes
through routers. If the value becomes zero or negative, the data is not forwarded. Thus it decides the
lifetime of the data.
Protocol: This field identifies the transport protocol running on top of IP. The upper layer software
piece can be TCP or UDP. This field specifies which piece of software at the destination node the
datagram should be passed on to.
Source address: This field contains the 32 bit IP address of the sender.
Destination address: This field contains the 32 bit IP address of the final destination.
IPv6 header:
IPv6 fixed header is 40 bytes long and contains the following information.
Traffic Class (8-bits): These 8 bit are divided into two parts. The most significant 6 bits are used for Type of
Service to let the Router Known what services should be provided to this packet. The least significant 2 bits
are used for Explicit Congestion Notification (ECN).
Flow label (20-bits): This label is used to maintain the sequential flow of the packets belonging to a
communication. The source labels the sequence to help the router identify that a particular packet belongs to
a specific flow of information. This field helps avoid reordering of data packets. It is designed for
36
streaming/real –time media.
Payload Length (16-bits): This field is used to tell the routers how much information a particular packet
contains in its payload. Payload is composed of Extension Headers and Upper Layer data. With 16 bits, up to
65535 bytes can be indicated, but if the Extension Headers contain Hop-by-Hop Extension Header, then the
payload may exceed 65535 bytes and this field is set to 0.
Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the Extension
Header is not present then it indicates the Upper Layer PDU. The values for the type of Upper Layer.
Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is same as TTL in
IPV4. The value of Hop Limit field is decremented by 1 as it passes a link (router/hop). When the field
reaches 0 the packets is discarded.
Source Address (128-bits): This field indicates the address of originator of the packet.
Destination Address (128–bits): This field provides the address of intended recipient of the packet.
37
Explain registered and unregistered IP address.
Registered IP:
1. A public address that is visible on the Internet. Contrast with an "unregistered IP" address, which is
private and not exposed to anyone outside of the company or home network. Except for very large
companies, registered IPs are allocated to the Internet service provider (ISP), which assigns them to its
customers.
Unregistered IP:
1. An Internet Protocol (IP) address set aside for use within a LAN, intranet, or other private network
and not for use in a public network such as the Internet.
2. An IP address within three ranges of numbers that are set aside for the computers in local networks.
Typically assigned to the machines by a DHCP server, these private addresses are not routed over the
Internet. In order to gain access to the Internet, the private addresses are converted to a public IP
address that is exposed to the Internet by a network address translation (NAT) service
38
Explain the process of DHCP server configuration.
39
40
Explain configuration of TCP/IP protocol in network.
Before beginning configuration procedure, the following are the prerequisites.
1. Network hardware is installed and cabled. .
2. TCP/IP software is installed. To configure your TCP/IP network, the following steps are followed:
3. Read TCP/IP protocols for the basic organization of TCP/IP.
4. Minimally configure each host machine on the network. This means adding a network adapter,
assigning an IP address, and assigning a host name to each host, as well as defining a default route to
your network. For background information on these tasks, refer to TCP/IP network interfaces, TCP/IP
addressing, and Naming hosts on your network.
5. Configure and start the intend daemon on each host machine on the network. Read TCP/IP daemons
and then follow the instructions in Configuring the intend daemon.
6. Configure each host machine to perform either local name resolution or to use a name server. If a
hierarchical Domain Name networks being set up, configure at least one host to function as a name
server.
7. If the network needs to communicate with any remote networks, configure at least one host to
function as a gateway. The gateway can use static routes or a routing daemon to perform inters network
routing.
8. Decide which services each host machine on the network will use. By default, all services are
available. Follow the instructions in Client network services if you wish to make a particular service
unavailable.
9. Decide which hosts on the network will be servers, and which services a particular server will
provide. Follow the instructions in Server network services to start the server daemons you wish to
run.
10. Configure any remote print servers that are needed.
11. Optional: If desired, configure a host to use or to serve as the master time server for the network.
Types of Servers:
• File and print Servers
• Application Servers
• Email servers
• Networking Servers like DHCP, VPN etc.
• Internet Servers like web, internet email, Proxy Server etc.
• Remote Access Servers
Explain the various fields in the frame format of UDP with a neat diagram.
Source port number: This field identifies the sender's port when meaningful and should be assumed
to be the port to reply to if needed. If not used, then it should be zero. If the source host is the client,
the port number is likely to be an ephemeral port number. If the source host is the server, the port
number is likely to be a well-known port number.
Destination port number: This field identifies the receiver's port and is required. Similar to source
port number, if the client is the destination host then the port number will likely be an ephemeral port
43
number and if the destination host is the server then the port number will likely be a well-known port
number.
Length: A field that specifies the length in bytes of the UDP header and UDP data. The minimum
length is 8 bytes because that is the length of the header. The field size sets a theoretical limit of 65,535
bytes (8 byte header + 65,527 bytes of data) for a UDP datagram. The practical limit for the data length
which is imposed by the underlying IPv4 protocol is 65,507 bytes (65,535 − 8 byte UDP header − 20
byte IP header). In IPv6 jumbogram it is possible to have UDP packets of size greater than 65,535
bytes. RFC 2675 specifies that the length field is set to zero if the length of the UDP header plus UDP
data is greater than 65,535.
Checksum: The checksum field may be used for error-checking of the header and data. This field is
optional in IPv4, and mandatory in IPv6. The field carries all-zeros if unused.
44
Introduction –Addressing mechanism in the Internet
https://www.youtube.com/watch?v=_ISu9f8ofZk IP Addressing
https://www.youtube.com/watch?v=DqU3KVCyFNg Subnetting-part1
https://www.youtube.com/watch?v=NuVqcOq9YtY Subnetting-part2
https://www.youtube.com/watch?v=0sBEJiUoTPI Subnetting-part3
Address Space:
IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than 4 billion).
This means that, theoretically, if there were no restrictions, more than 4 billion
devices could be connected to the Internet.
Notations
There are two prevalent notations to show an IPv4 address: Binary notation and Dotted decimal
notation.
➢ Binary Notation:
o In binary notation, the IPv4 address is displayed as 32 bits.
o Each octet is often referred to as a byte.
o So it is common to hear an IPv4 address referred to as a 32-bit address or a 4-
45
byte address.
o The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010
➢ Dotted-Decimal Notation:
o To make the IPv4 address more compact and easier to read, Internet
addresses are usually written in decimal form with a decimal point (dot)
separating the bytes.
o Each byte is identified by a decimal number in the range [0..255].
o The following is the dotted decimal notation of the above address:
117.149.29.2
o Example:
Example: Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Solution:
We replace each group of 8 bits with its equivalent decimal number and add dots for separation.
a. 129.11.11.239
b. 193.131.27.255
IP Address classes
• IPv4 addressing, at its inception, used the concept of classes.
• This architecture is called classful addressing.
• In classful addressing, the address space is divided into five classes: A, B, C, D,
and E.
• Each class occupies some part of the address space.
• We can find the class of an address when given the address in binary notation or
dotted-decimal notation.
• If the address is given in binary notation, the first few bits can immediately tell us
the class of the address.
46
Fig: Finding the class in binary notation.
• If the address is given in decimal-dotted notation, the first byte defines the
class.
47
Class A:
• The high-order (First) bit in a class-A address is always set to zero.
• The next seven bits complete the network ID.
• The remaining 24 bits represent the host ID.
• This allows for 128 networks and 16,777,214 hosts per network.
• In this 7 bits are used for network field and 24 bits for host field.
• Class A IP address range includes 1.0.0.0 to 127.255.255.255
Class B:
• Class B addresses are assigned to medium-sized to large-sized networks.
• The two high-order bits in a class B address are always set to binary 1 0.
• The next 14 bits complete the network ID.
• The remaining 16 bits represent the host ID.
• This allows for 16,384 networks and 65,534 hosts per network.
• Class B IP address range includes 128.0.0.0 to 191.255.255.255
Class C:
• Class C addresses are used for small organizations with a small number of attached
hosts or routers.
• The three high-order bits in a class C address are always set to binary 1 1 0.
• The next 21 bits complete the network ID.
• The remaining 8 bits (last octet) represent the host ID.
• This allows for 2097152 networks and 256 hosts per network.
• Class C IP address range includes 192.0.0.0 to 223.255.255.255.
Class D:
• Class D addresses are reserved for IP multicast addresses.
• The four high-order bits in a class D address are always set to binary 1 1 1 0.
• The remaining bits recognize hosts.
• Class D IP address range includes 224.0.0.0 to 239.255.255.255
48
Class E:
• Class E is an experimental address that is reserved for future use.
• The high-order bits in a class E address are set to binary 1111.
• Class E IP address range includes 240.0.0.0 to 255.255.255.255
M
a
s
k
49
• Although the length of the netid and hostid (in bits) is predetermined in classful addressing,
we can also use a mask (also called the default mask/natural masks), a 32- bit number made of
contiguous 1’s followed by contiguous 0’s.
• The masks for classes A, B, and C are shown in Table.
• The concept does not apply to classes D and E.
• The mask can help us to find the netid and the hostid.
• For example, the mask for a class-A address has eight 1s, which means the first 8 bits of any
address in class A define the netid; the next 24 bits define the hostid.
Subnetting
• If an organization was granted a large block in class A or B, it could divide the addresses into
several contiguous groups and assign each group to smaller networks (called subnets) or, in
rare cases, share part of the addresses with neighbors.
• Subnetting increases the number of 1’s in the mask.
• To create multiple logical networks that exist within a single Class A, B, or C network.
• If you do not subnet, you are only able to use one network from your Class A, B, or C
network, which is unrealistic.
• The subnet mask follows two rules:
o If a binary bit is set to a 1 (or on) in a subnet mask, the corresponding bit in the
address identifies the network.
o If a binary bit is set to a 0 (or off) in a subnet mask, the corresponding bit in the
address identifies the host.
Finding The Subnet Address: We use binary notation for both the address and the mask and then
apply the AND operation to find the subnet address.
Example: What is the subnetwork address if the destination address is 200.45.34.56 andthe subnet
mask is 255.255.240.0?
Solution :
Step 1: Convert given IP and Subnet mask to Binary Step 2:
Perform AND Operation on these two.
11001000 00101101 00100010 00111000 Binary 200.45.34.56
11111111 11111111 11110000 00000000 Subnet Mask 255.255.255.0
11001000 00101101 00100000 00000000
The subnetwork address is 200.45.32.0.
50
Step 3: Convert the result of AND operation to Dotted Decimal format which is Subnet mask.
Example 2: (VIMP)
A company is granted the site address 201.70.64.0 (class C). The company needs six
subnets. Design the subnets.
Solution:
• The number of 1s in the default mask is 24 (class C).
• The company needs six subnets.
• This number 6 is not a power of 2.
• The next number that is a power of 2 is 8 (23).
• We need 3 more 1’s in the subnet mask.
• The total number of 1’s in the subnet mask is 27 (24 + 3).
• The total number of 0’s is 5 (32 - 27).
• The mask is
11111111 11111111 11111111 11100000
or
255.255.255.224
• The number of subnets is 8.
• The number of addresses in each subnet is 25 (5 is the number of 0s) or 32.
• Subnet 1:
The bit combination is 001.
Taking last octet in binary:0 0 1 0 0 0 0 0 = 32 (10)Hence
the subnet address is, 201.70.64. 32
• Subnet 2:
The bit combination is 01 0.
Taking last octet in binary:0 0 1 0 0 0 0 0 = 64(10)Hence
the subnet address is, 201.70.64. 64
• Subnet 3:
The bit combination is 011.
Taking last octet in binary:0 1 1 0 0 0 0 0 = 96(10)Hence
the subnet address is, 201.70.64. 96
• Subnet 4:
The bit combination is 100.
Taking last octet in binary :1 0 0 0 0 0 0 0 = 128(10)Hence
the subnet address is, 201.70.64. 128
• Subnet 5:
The bit combination is 101.
Taking last octet in binary :1 0 1 0 0 0 0 0 = 160(10)Hence
the subnet address is, 201.70.64. 160
• Subnet 6:
The bit combination is 110.
Taking last octet in binary :1 1 0 0 0 0 0 0 = 192 (10)Hence
the subnet address is, 201.70.64. 192
51
Example 3:
A company is granted the site address 181.56.0.0 (class B). The company needs 1000subnets.
Design the subnets.
Solution:
Supernetting
• The most of the class A and class B addresses were exhausted; however, there was still a huge
demand for midsize blocks.
• The size of a class C block with a maximum number of 256 addresses did not satisfy the
needs of most organizations.
• One solution was supernetting.
• In supernetting, an organization can combine several class C blocks to create a larger range of
addresses.
52
• In other words, several networks are combined to create a supernetwork or a supernet.
• An organization can apply for a set of class C blocks instead of just one.
• For example, an organization that needs 1000 addresses can be granted four contiguous class
C blocks.
• The organization can then use these addresses to create one supernetwork.
• Supernetting decreases the number of 1’s in the mask.
• For example,
o if an organization is given four class C addresses, the mask changes from 24 to 22.
Example:
• We need to make a supernetwork out of 16 class C blocks. What is the supernet mask?
Solution:
• We need 16 blocks.
• For 16 blocks we need to change four 1s to 0s in the default mask. So the mask is
11111111 11111111 11110000 00000000
Or
53
255.255.240.0
Address Depletion
• The flaws in classful addressing scheme combined with the fast growth of the
Internet lead to the near depletion of the available addresses.
• Yet the number of devices on the Internet is much less than the 232 address
space.
• We have run out of class A and B addresses, and a class C block is too small for
most midsize organizations.
• One solution that has alleviated the problem is the idea of classless addressing.
Classless Addressing
• To overcome address depletion and give more organizations access to the
Internet, classless addressing was designed and implemented.
• In this scheme, there are no classes, but the addresses are still granted in blocks.
Address Blocks
54