2. Protocols and protocol layering
Network Protocols
A protocol is a set of rules that governs data communications
A protocol defines what is communicated, how it is communicated, and
when it is communicated
To request any service or exchange any information between 2 devices there
must be an agreed set of commands and data formats
For instance, for one computer to send a message to another computer, the
first computer must perform the following general steps
break the data into small sections called packets
add addressing information to the packets identifying the source and
destination computers
deliver the data to the network interface card for transmission over the
network
3. Cont.…
The receiving computer must perform the same steps, but in reverse order
accept the data from the NIC
remove transmitting information that was added by the transmitting
computer
reassemble the packets of data into the original message
The key elements of a protocol are syntax, semantics, and timing
syntax: refers to the structure or format of the data
Semantics: refers to the meaning of each section of bits
Timing: refers to when data should be sent and how fast they can be sent
4. Protocol layering
• Protocol layering is a common technique to simplify networking designs by
dividing them into functional layers, and assigning protocols to perform each
layer's task
• For example, it is common to separate the functions of data delivery and
connection management into separate layers
• Thus, one protocol is designed to perform data delivery, and another protocol,
layered above the first, performs connection management
• The data delivery protocol is fairly simple and knows nothing of connection
management
• The connection management protocol is also fairly simple, since it doesn't need
to concern itself with data delivery
5. Cont….
• The most important layered protocol designs are:
The OSI (Open Systems Interconnection) Reference Model
The TCP/IP Reference Model
7. Layer 7: The Application Layer
• The application layer running on the sending system
(COMPUTER) is responsible for the actual request to be made
• This could be any type of networking request—a web request
using a web browser (HTTP), an e-mail delivery request using
SMTP, or a file system request using FTP protocols
• Application layer protocols are:- HTTP, FTP, SMTP
8. Layer 6: The Presentation Layer
• After the request is made, the application layer passes the data down to the
presentation layer
• The Presentation Layer handles data format information for networked
communications.
• This is done by converting data into a generic format that could be understood
by both sides.
• Performs three major functionalities:-
• Translation
• Data compression
• Encryption
9. Layer 5: The Session Layer
• Controls the connections between multiple computers
• The session layer manages the dialog between computers
• It does this by establishing, managing, and terminating
communications between two computers
• So it performs:
• Session management
• Authentication and
• Authorization
10. Layer 4: The Transport Layer
• The transport layer handles transport functions such as reliable delivery of the
data
• For reliable transport protocols, the transport layer works hard to ensure reliable
delivery of data to its destinations
• The transport layer is responsible for
• Segmentation
• Flow control
• Error correction
• Missing packets are determined by the fact that the transport layer receives
acknowledgments (ACKs) from the remote system, when the remote system
receives the packets
11. Layer 3: The Network Layer
• The network layer is responsible for managing and the delivery, or
routing of packets by using information stored in a routing
table
• The routing table is a list of available paths that are stored in
memory on the routers
• The network layer is responsible for working with
• Logical addressing
• Routing
• Path determination
12. Layer 2: The Data Link Layer
• The data link layer is responsible for physical addressing
• MAC addressing of the sender and receiver for each packet to form a frame
• Data unit used at data link layer is called a frame
• Is responsible for error correction functions
13. Layer 1: The Physical Layer
• The bottom layer of the OSI hierarchy is concerned only with moving bits of data
onto and off the network medium
• Responsible for converting the data from a frame to a pattern of signals that
will be used to send the data across the communication medium.
• On the receiving system, the signals will be converted to packets by the data
link layer and then passed up to the network layer for further processing
• Cable, connectors, repeaters, transmitters, receivers, are associated with physical
layer
14. Network devices
• Network devices and technologies comprised of components that is
necessary to establish a network infrastructure and environment.
• Among includes are the following:
Repeaters:
• One of the pitfalls of networking environments is that the electrical signal that is
traveling the wire is weakened over distance as a result of outside
interference
• Eventually, if two systems are too far from one another, the signal is so
weak that by the time it reaches the other side it is unreadable
• Using a repeaters we can regenerator a signal
• With reference of the ISO model, a repeater is considered as a level-1 relay
16. Cont..
Hub
• A hub connects multiple wires coming from different decvices,
• They act as a central point for all network devices to connect to
• For example, the connector in star topology which connects different
stations
• Hubs cannot filter data, so data packets are sent to all connected devices
• Is a layer-1 device, would forward the signal to all ports on the hub,
which will lead to traffic problems as you start adding hubs to the
topology
• Introduce:
• High traffic
• Less secured
• Slow
18. Cont….
Switches
• Switch is data link layer device
• A switch functions by separating signals between any pair of port
lines
• When working with hubs, a hub sends the data to all ports on the
hub but, in case of a switch each port operates on separate collision
domain.
• Moreover, in case of a hub, the bandwidth is shared by all the
stations connected to all the ports. On the other hand, in case of a
switch, each port has dedicated bandwidth
20. Cont…
Routers
• Routers are layer-3 devices and are responsible for routing
• Sending data from one network to another
• In the figure, notice that if a system on Network A wants to send data to
a system on Network B, it must leave Network A by means of Router 1 and then
Router 1 will send the data to Router 2. It is the responsibility of Router 2 to send
the data to the destination computers
• Routers use a routing table stored in memory on the router to determine
how to reach a system on a destination network.
22. Cont…
Wireless Access Points
• Are network devices that can be connected to the wired network to
allow a wireless client to pass through to get access to the wired network
and its resources
• The wireless access point is connected to a physical cable, which connects the
WAP device to the rest of the network
23. Frame
• Frames are generated at Layer 2 by the network interface device with a payload
size that depends on the type of data being transmitted
• The frame is sent onto the network where an Ethernet switch checks the
destination address of the frame against a MAC lookup table in its memory
• A frame cannot be sent outside of the local/private network onto the internet
because it does not have the proper address. To send data to a device on a
different network or to an internet server, a frame must be built into a packet
24. IP packet
IP packets
• Packets are created at Layer 3 of the network and allow information to be
exchanged between different LANs, typically via routers
• A router interconnects small networks (LANs) together allowing for information
exchange on a much larger scale using IP addresses for packet forwarding
instead of MAC addresses
• A packet is a solitary unit of data interchanged between two devices on a
network.
• The router uses IP packet header to send packets through the network from
source to destination.
25. Key Differences Between Frame and Packet
• A Frame can be defined as a data unit used in Data Link layer. On the other
hand, a packet is the protocol data unit used in the network layer.
• Frames are formed in data link layer of the OSI whereas Packets are formed in
Network layer.
• Framing includes the source and destination MAC addresses (i.e., the physical
address of the machine). In contrast, packet includes the source and destination
IP addresses.
• Packet encapsulates segment in the network layer. On the contrary, Frames
encapsulates packets in the data link layer.
27. Cont…
• Version—Indicates the version of IP currently used.
• IP Header Length (IHL)—Indicates the datagram header length in 32-bit words.
• Type-of-Service—Specifies how an upper-layer protocol would like a current
datagram to be handled, and assigns datagrams various levels of importance.
• Total Length—Specifies the length, in bytes, of the entire IP packet, including the
data and header.
• Identification—Contains an integer that identifies the current datagram.
• Header Checksum—Helps ensure IP header integrity.
• Source Address—Specifies the sending node.
• Destination Address—Specifies the receiving node.
• Time-to-Live—Maintains a counter that gradually decrements down to zero, at
which point the datagram is discarded
28. UDP Datagram
• UDP provides an unreliable connectionless delivery service using IP to
transport messages between two processes
• UDP messages can be lost, duplicated, delayed and can be delivered out of
order
• It cannot provide reliable stream transport service
• Different fields of the datagram are given below:
• Source port (16 bits): It defines the port number of the application
program in the host of the sender
• Destination port (16 bits): It defines the port number of the application
program in the host of the receiver
• Length: It provides a count of octets in the UDP datagram, minimum
length = 8
29. TCP datagram
• The above limitations can be overcome by using connection-oriented transport
layer protocol known as Transmission Control Protocol (TCP).
• Provides a connection-oriented and reliable delivery service using IP to transport
messages between two processes.
• Reliability is ensured by:
• Connection-oriented service
• Flow control
• Error detection using checksum
• Error control using retransmission technique
31. Cont…
A brief explanation of the functions of different fields is given below:
• Source port (16 bits): It defines the port number of the application program in
the host of the sender
• Destination port (16 bits): It defines the port number of the application program
in the host of the receiver
• Sequence number (32 bits): It conveys the receiving host which octet in this
sequence comprises the first byte in the segment
• Acknowledgement number (32 bits): This specifies the sequence number of the
next octet that receiver expects to receive
• HLEN (4 bits): This field specifies the number of 32-bit words present in the TCP
header
32. Cont…
• PSH: Push the data without buffering
• RST: Resent the connection
• SYN: Synchronize sequence numbers during connection establishment
• FIN: Terminate the connection
• Window (16 bits): Specifies the size of window
• Checksum (16 bits): Checksum used for error detection.
• User pointer (16 bits): Used only when URG flag is valid
• Options: Optional 40 bytes of information
• Control flag bits (6 bits): URG: Urgent pointer
• ACK: Indicates whether acknowledge field is valid
33. IP addressing
• Every host connected to an internet must have a unique IP address on that network
• The address in IPv4 is a 32 bit number. But for IPV6 has 128-bit address length
• It is usually represented as 4, 8 bit numbers separated by dots,
• An IP address looks similar in appearance to 192.168.1.15
• In order to address different networks on an internet the address is structured into a
network part and a host part
• Each decimal value is made up of 8 bits (1s and 0s), and there are four decimal values
• Since each of the decimal values is made up of 8 bits (for example, the 192), we refer to
each of the decimal values as an octet.
• There are four octets in an IP address. It is very important to understand that
the four octets in an IP address are divided into two parts—a network ID and a host ID.
• The subnet mask determines the number of bits that make up the network ID and the
number of bits that make up the host ID
34. Cont…
Subnet Mask
• Used to define which part of the host address will be used as the subnet address
• A 32-bit value that allows the recipient of IP packets to distinguish the network
ID portion of the IP address from the host ID portion
35. Cont…
• When looking at a subnet mask, if there is a 255 in an octet, then the
corresponding octet in the IP address is part of the network ID
• For example, if I had an IP address of 192.168.1.15 and a subnet mask
of 255.255.255.0, the first three octets would make up the network ID and the
last octet would be the host ID
• The network ID assigns a unique address to the network itself, while the
host ID uniquely identifies the system on the network
36. Default Gateway
• When your system wants to send data to another system on the network, it looks
at its own network ID and compares that to the destination system‘s IP address
• If it appears that they both have the same network ID, the data is sent directly
from your system to the destination system
• If the two systems are on different networks, your system must pass the data
to the router so that the router can send the data to the destination system‘s
router
• To calculate the binary value of an octet with a decimal number such as 192,
you need to enable, or turn on, the bits that will add up to the number of 192, as
shown in Table 4-4
38. Classless Inter-Domain Routing (CIDR)
• Used to allocate an amount of IP address space to a given entity
(company, home, customer, etc).
• Example: 192.168.10.32/28
• The slash notation (/) means how many bits are turned on (1s) and
tells you what your subnet mask is.
40. Address Classes
• Every IP address belongs to a distinct address class.
• The Internet community defined these classes to accommodate networks of various
sizes.
• The class to which the IP address belongs initially determines the network ID and
host ID portions of the address, along with the number of hosts that are supported on
that network.
• The different class addresses are named class A, class B, class C, class D, and class E.
Class A Addresses
• A class A address has a default subnet mask of 255.0.0.0, which means that the first
octet is the network ID and the last three octets belong to the host ID portion of the
address
• Each octet can contain 256 possible values (0–255), so a class A address supports
16,777,216 hosts on the network (256 × 256 × 256)
41. Cont….
Class B Addresses
• Class B addresses have a default subnet mask of 255.255.0.0, which
means that the first two octets are the network ID and the last two octets
are the host ID portion of the address
• This means that we can have 65,536 hosts (256 × 256) on the network
Class C Addresses
• Class C addresses have a subnet mask of 255.255.255.0, which means that
the first three octets are the network ID and the last octet is the host ID.
Having only one octet as the host ID means that a class C address can
support only 254 hosts (256-2) on the network
42. Cont…
Class D Addresses (refer for more explanation)
• Class D addresses are used for special types of applications on the network
known as multicasting applications.
• Multicast means sending some information to some predefined group of
users/networks (Intended ones, as they want to receive).
Class E Addresses
• The funny thing about class E addresses is that they were designed for
experimental purposes only, so you will never see a class E address on a
network
• 127.0.0.0 for loopback why?
43. Private Addresses
• Another type of address you need to be aware of is what is known as a private
address.
• A private IP address is the address space allocated by InterNIC to allow
organizations to create their own private network
• A private address is an address that can be assigned to a system but cannot be
used for any kind of Internet connectivity.
• The private addresses are non routable addresses, so any system using them will
not be able to function off the network.
• The computers, tablets and smartphones sitting behind your home, and the
personal computers within an organizations are usually assigned private IP
addresses. A network printer residing in your home is assigned a private address
so that only your family can print to your local printer.
44. Cont…
• The following are the three address ranges that are private:
• 10.0.0.0–10.255.255.255
• 172.16.0.0–172.31.255.255
• 192.168.0.0–192.168.255.255
45. Subnetting
• Subnetting is the strategy used to partition a single physical network into more
than one smaller logical sub-networks (subnets).
• An IP address includes a network segment and a host segment.
• Subnets are designed by accepting bits from the IP address's host part and using
these bits to assign a number of smaller sub-networks inside the original
network.
• Subnetting allows an organization to add sub-networks without the need
to acquire a new network number via the Internet service provider (ISP).
46. Cont….
• Subnetting helps to reduce the network traffic and conceals network
complexity.
• Subnetting is essential when a single network number has to be allocated over
numerous segments of a local area network (LAN).
Benefits of subnetting include:
• Reduced network traffic
• Optimized network performance
• Simplified management
47. How To Create Subnets
• Take bits from the host portion of the IP address and reserve them to
define the subnet address
1. Determine the number of required network IDs:
• One for each subnet
• One for each wide area network connection
2. Determine the number of required host IDs per subnet:
• One for each TCP/IP host
• One for each router interface
3. Based on the above requirements, create the following:
• One subnet mask for your entire network
• A unique subnet ID for each physical segment
• A range of host IDs for each subnet
48. Cont….
Before starting, you need to do is answer five simple questions:
1. How many subnets does the chosen subnet mask produce?
2. How many valid hosts per subnet are available?
3. What are the valid subnets?
4. What’s the broadcast address of each subnet?
5. What are the valid hosts in each subnet?
49. Cont..
• How many subnets?
• 2x = number of subnets. x is the number of masked bits, or the 1s.
• For example, given a class C subnet mask of 255.255.255.192, the number of
ones gives us 22 = 4 subnets.
• Note that we only count the number of ones that are found in the host part of
the subnet mask.
• For class C address 255.255.255.0 is the default subnet, 192=11000000 in
binary, so there are only 2 ones.
50. Cont…
• How many hosts per subnet?
• 2y – 2 = number of hosts per subnet. y is the number of unmasked bits, or the
0s. For example, in 11000000, the number of zeros gives us 26 – 2 = 62 hosts
per subnet.
• You need to subtract two for the subnet address and the broadcast address,
which are not valid hosts.
• What are the valid subnets?
• First calculate the block size.
• 256 – subnet mask = block size, or increment number.
• An example would be 256 – 192 = 64. The block size of a 192 mask is always
64.
• Second, start counting at zero in blocks of 64 until you reach the subnet
mask value and these are your subnets. 0, 64, 128, 192.
51. Cont….
• What’s the broadcast address for each subnet?
• Since we counted our subnets in the last section as 0, 64, 128, and 192, the
broadcast address is always the number right before the next subnet.
• For example, the 0 subnet has a broadcast address of 63 because the next
subnet is 64. The 64 subnet has a broadcast address of 127 because the next
subnet is 128, etc.
• And remember, the broadcast of the last subnet is always 255 for Class C.
• What are the valid hosts?
• Valid hosts are the numbers between the subnets, omitting all the 0s and all
1s.
• For example, if 64 is the subnet number and 127 is the broadcast address,
then 65–126 is the valid host range—it’s always the numbers between the
subnet address and the broadcast address.
• These are the addresses you assign to nodes.
52. Example for subnetting
We’re going to subnet the network address 192.168.10.0 and subnet mask
255.255.255.224.
1. How many subnets?
• 224 is 11100000, so our equation would be 23 = 8.
2. How many hosts?
• 25 – 2 = 30.
3. What are the valid subnets?
• 256 – 224 = 32. We just start at zero and count to the subnet mask value in
blocks (increments) of 32: 0, 32, 64, 96, 128, 160, 192, 224.
4. What’s the broadcast address for each subnet?
• always the number right before the next subnet
5. What are the valid hosts?
• the numbers between the subnet number and the broadcast address
53. Cont…
• To answer questions 4 and 5, first just write out the subnets, then write out the
broadcast addresses—the number right before the next subnet. Lastly, fill in the
host addresses.
• So now we have
192.168.10.1/27 – 192.168.10.30/27 ntk 1
192.168.10.33/27 - 192.168.10.62/27 ntk 2
upto …
192.168.10.225/27 - 192.168.10.254/27 ntk 8
54. Exercise
• Do full subnetting for the following addresses.
1. 192.168.10.0/28
2. 192.0.10.0/30
3. 192.1.1.0/25
• What is the maximum and minimum CIDR values for a class C network?
55. VLAN
• VLAN is a logical grouping of network users and resources connected to
administratively defined ports on a switch.
• It support smaller broadcast domain and is organized by location, function,
department and application or protocol.
• Virtual LANs (or VLANs) separate a Layer-2 switch into multiple broadcast
domains.
• Each VLAN is its own individual broadcast domain (i.e. IP subnet).
• Individual ports or groups of ports can be assigned to a specific VLAN.
• Only ports belonging to the same VLAN can freely communicate; ports assigned
to separate VLANs require a router to communicate.
• Broadcasts from one VLAN will never be sent out ports belonging to another
VLAN
• Ports (interfaces) on switches can be assigned to one or more VLANs, enabling
systems to be divided into logical groups -- based on which department they are
56. Cont…
• Data communications between VLANs is performed by routers. Modern switches
often incorporate routing functionality and are called Layer 3 switches.
57. Cont…
• Four computers are connected to a Layer-2 switch that supports VLANs.
Computers A and B belong to VLAN 1, and Computers C and D belong to
VLAN 2.
• Because Computers A and B belong to the same VLAN, they belong to the
same IP subnet and broadcast domain.
• They will be able to communicate without the need of a router
• Computers C and D likewise belong to the same VLAN and IP subnet.
• They also can communicate without a router. However, Computers A and B
will not be able to communicate with Computers C and D, as they belong
to separate VLANs, and thus separate IP subnets.
• Broadcasts from VLAN 1 will never go out ports configured for VLAN 2.
• A router will be necessary for both VLANs to communicate.
58. Benefits of VLANs
• Simplified administration for the network manager: One of the best things about
virtualization is that it simplifies management. By logically grouping users into
the same virtual networks, you make it easy to set up and control your policies at
a group level. When users physically move workstations, you can keep them on
the same network with different equipment. Or if someone changes teams but
not workstations, they can easily be given access to whatever new VLANs they
need.
• Improved security: Using VLANs improves security by reducing both internal and
external threats. Internally, separating users improves security and privacy by
ensuring that users can only access the networks that apply to their
responsibilities. External threats are also minimized. If an outside attacker is able
to gain access to one VLAN, they’ll be contained to that network by the
boundaries and controls you have in place to segment it from your others.
59. Cont…
• Easier fault management: Troubleshooting problems on the network can be
simpler and faster when your different user groups are segmented and isolated
from one another. If you know that complaints are only coming from a certain
subset of users, you’ll be able to quickly narrow down where to look to find the
issue.
• Improved quality of service: VLANs manage traffic more efficiently so that your
end users experience better performance. You’ll have fewer latency problems on
your network and more reliability for critical applications. VLANs also make
prioritizing traffic much easier, allowing you to make sure critical application data
keeps flowing even when lower priority traffic like web browsing spikes.
60. In a Class C address, only 8 bits are available for defining the hosts. Remember that
subnet bits start at the left and go to the right, without skipping bits. This means that
the only Class C subnet masks can be the following
61. Routing
• Now that you have an understanding of subnetting, the next topic to discuss is
routing.
• Routing is the concept of sending data from one network to another.
• Once we have the network broken into segments, it is up to the routers to route
the data from one network segment to another
• The router is responsible for routing information to the destination network, and
it does this by using what is known as a routing table.
• A routing table is a list of destination networks that resides in memory on
the router, and the router uses this to identify where to send data to reach the
destination.
• If the destination is not in the routing table, the router will not be able to send
the information to the destination