0% found this document useful (0 votes)
6 views80 pages

NET-13-L1 Computer Networking Final Project

The document outlines a final project for a Computer Networking course, focusing on setting up a wide area network (WAN) for a mock bank, including tasks such as designing IP schemes, configuring VLANs, implementing security solutions, and ensuring inter-VLAN routing. It provides detailed instructions for various lab tasks, including IP address assignments, VLAN configurations, OSPF setup, and security measures for network devices. The project requires advanced knowledge of networking concepts and the use of Cisco Packet Tracer for simulation.

Uploaded by

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

NET-13-L1 Computer Networking Final Project

The document outlines a final project for a Computer Networking course, focusing on setting up a wide area network (WAN) for a mock bank, including tasks such as designing IP schemes, configuring VLANs, implementing security solutions, and ensuring inter-VLAN routing. It provides detailed instructions for various lab tasks, including IP address assignments, VLAN configurations, OSPF setup, and security measures for network devices. The project requires advanced knowledge of networking concepts and the use of Cisco Packet Tracer for simulation.

Uploaded by

arjunmohanraj143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cybersecurity Professional Program

Computer Networking
Lab Assignment
Final Project
NET-13-L1
Computer Networking
Final Project

Page 1
Lab Objective
Test learner level of knowledge and skill acquired through topics covered in the
Computer Networking course. Topics include design and implementation of IP
schemes, VLAN configuration, dynamic routing configuration, security solution
implementation, and basic network device configuration.

Lab Mission
Set up a wide area network (WAN) for a mock bank that includes three LANs (one
of which will be partitioned with three VLANs), and configure all network devices
and endpoints to communicate with the entire WAN.

Requirements
 Advanced knowledge of networking concepts and the Cisco IOS

Resources
 Environment & Tools
o Cisco Packet Tracer 8.0 or later
 Files
o [Link]

Page 2
Instructions for PKA Lab Files
Lab materials include the lab document and a PKA lab file.
Open the PKA file through the Cisco Packet Tracer menu by clicking File and then
Open….

Navigate to the file's location and open it.

Page 3
Note: Double-clicking the PKA file in your file explorer may not work (depending
on the Packet Tracer version).
When you open a PKA file in Cisco Packet Tracer, two windows appear:
1. Lab topology window
2. Activity window

PKA Features
Note the following essential information regarding the Activity window:
1. Completion Percentage: Learner progress appears at the bottom right
corner of the window.
2. Check Result Button: When you click this button and then click the
Assessment Items tab, you will find a checklist with lab objectives and
status, where V means done, and X means not done.
Note: Both features help the instructor grade the exercise swiftly and efficiently.

Page 4
Scenario
As a junior network administrator, you and your team were tasked with planning
and configuring a corporate network for a new bank branch in Miami. It is your
duty to set up the network correctly and implement basic security settings on all
systems.
Note: The correct hostnames are already set on all devices.

Physical Topology

Page 5
Lab Task 1: Design an IP Address Scheme
Devise a network topology plan for the number of subnets you will need and
where you want to assign the IPv4 addresses within each subnet.

1 Divide the [Link]/24 network into eight subnets. Fill out the
Addressing Table below:
Table 1:Addressing Table

Subnet Network Usable Host Broadcast


Number Address Address Range Address

2 What is the value of the new subnet mask?


3 How many usable host addresses exist per subnet?

Page 6
Lab Task 2: Implement VLANs and Trunk
Configure VLANs and set trunks on the appropriate network and its associated
devices.
Note: Perform steps 1–4 on S1-Office1 and S2-Office1.

1 Create and name VLANs as follows:


 VLAN 10: Management
 VLAN 20: Marketing
 VLAN 30: Accounting
 VLAN 100: Native
2 On S1-Office1 and S2Office1, configure the interfaces as access mode and
assign VLANs as follows:
 VLAN 10: FastEthernet0/1-10
 VLAN 20: FastEthernet0/11-20
 VLAN 30: FastEthernet0/21-24
3 Configure the S1-Office1 to S2-Office1 interconnecting link as trunk on
both.
Note: To simplify the identification of the ports, click Options…, click
Preferences…, and select Always Show Port Labels in Logical Workspace.

Page 7
4 Verify the VLAN and trunk configurations using the appropriate show
commands and save the configuration.

Page 8
5 On both switches, disable DTP only on the access ports.
Page 9
Lab Task 3: Assign IP Addresses
Using the table, you made in Task 1, assign subnets addresses to the topology.
Note: Make sure to document the assignment of the IP addresses in a separate
file to keep track of them.

1 Assign the first usable IP address and appropriate subnet mask of subnet 1
to the R3 interface connected to the Office3 network.
2 Assign the first usable IP address and appropriate subnet mask of subnet 2
to the R3 interface connected to the Office2 network.
3 Assign the first and second usable IP address and appropriate subnet mask
of subnet 3 to the R1 <-> R2 WAN link.
4 Assign the first and second usable IP address and appropriate subnet mask
of subnet 4 to the R1 <-> R3 WAN link.
5 Assign the first and second usable IP address and appropriate subnet mask
of subnet 5 to the R2 <-> R3 WAN link.
6 Assign the last usable addresses of subnet 6 to the Office1 network CEO
end devices. Also, assign a subnet mask and the default gateway (first
address in the subnet).
Note: Layer 3 connectivity with VLANs requires a router-on-a-stick setup.
7 Assign the last usable addresses of subnet 7 to the Office1 network
Copyrighter end devices. Also, assign a subnet mask and the default
gateway (first address in the subnet).
8 Assign the last usable addresses of subnet 8 to the Office1 network Dialer
end devices. Also, assign a subnet mask and the default gateway (first
address in the subnet).
9 Assign the last useable IP addresses of subnet 2 (Office2) and subnet 1
(Office3) to the endpoints for each office network or VLAN. Also, assign the
default gateway (first address in the subnet).

Page 10
Lab Task 4: Configure R1 for Inter-VLAN Routing
Configure the router on the Office1 network to allow multiple VLANs to
communicate on the network.
Perform steps 1–4 on R1.

1 Enable GigabitEthernet 0/0 interface.


2 Create the following three sub-interfaces on GigabitEthernet 0/0:
Sub-interface 10, 20, and 30.
3 Set the correct encapsulation type and VLAN ID for each sub-interface.
Sub-interface 10 will route for VLAN 10, sub-interface 20 will route for
VLAN 20, and sub-interface 30 will route for VLAN 30.
4 Using the following Sub-Interface Addressing Table, configure the
appropriate IP address and subnet mask (using the first usable IP address
of each subnet) for each sub-interface. Refer to table you made in Task 1
for subnet IDs.
Table 2:Sub-interface Addressing Table

Sub-Interface # Subnet ID/VLAN #


Sub-interface 10 Subnet 6 (VLAN 10)
Sub-interface 20 Subnet 7 (VLAN 20)
Sub-interface 30 Subnet 8 (VLAN 30)

5 Check the settings on the router using the appropriate show command.
6 On S1-Office1, set both GigabitEthernet interfaces as trunk with
appropriate native VLAN. On S2-Office1, set only GigabitEthernet 0/1
interface as trunk with appropriate native VLAN.
7 Verify this part of the configuration using the appropriate show commands
and save the configuration.
8 Test the inter-VLAN routing by pinging Copyrighter1 and Dialer1 from the
CEO1 PC.

Page 11
Lab Task 5: Secure Switch Physical Ports
Configure all switches on the network to work with port security.
Perform steps 1–4 on the S1-Office1 and S2-Office1 switches.

1 Enable port security (only on ports connected to end devices).


Note: Implement port security only on access ports connected to end
devices (never on trunk ports).
Set the violation mode to restrict.
2 Secure authorized MAC addresses using sticky learning.
3 Verify the port security configuration using the appropriate show
commands.

4 Disable all remaining unused ports and save the configuration.

Page 12
Lab Task 6: Configure OSPF
Configure all routers on the network with OSPF to enable all subnets to
communicate.
Perform all steps on R1, R2, and R3.

1 Turn on the connected serial interfaces on each router using the no


shutdown command.
2 Turn on the connected gigabit interfaces on R3 using the no shutdown
command.
3 Configure the following for OSPF on each router:
 Process ID: 1
 Network IP for each network
 Router ID: R1-[Link] | R2 - [Link] | R3 - [Link]
 Area 0
4 Set interfaces connected to a LAN to passive.
5 Verify the OSPF configuration on R1 using the appropriate show
commands and save the configuration.

Page 13
Lab Task 7: Extended ACL
Configure ACLs to prevent guests on the network from connecting to the
NTP/Syslog server.
Perform steps 1–3 on R3.

1 Configure a numbered extended ACL with the following parameters:


 Traffic from the guest PC to the NTP/Syslog server is not permitted.
 All other network traffic is permitted.
 Apply an ACL on the correct interface and traffic direction.
2 Verify ACL configuration with a show command.
Note: The IP addresses may vary depending on those assigned.

3 From the guest's PC, test the ACL by pinging the NTP server and email
server.

Page 14
Lab Task 8: Initial and Security Settings for Network
Devices
Configure all network devices with basic security settings to prevent unauthorized
access.
Perform steps 1–5 on all routers and switches.

1 Configure console line to use local username Admin and password


ACDC1973 for access.
2 Secure privileged mode access with the password beatles1960.
3 Encrypt all passwords on the device.
4 Configure the following security message (hint: MOTD Banner): Only
authorized personnel are allowed accessing this device!
5 Save all running configurations to NVRAM.

Page 15
[Link]
m
Lab Task 9: Secure Remote Access
Configure SSHv2 services on all routers to allow for remote administration.
Perform steps 1–4 on R1, R2, and R3.

1 Set the IP domain name to [Link].


2 Generate secure keys (minimum key length is 1024 bits).
3 Set SSH version 2.
4 Configure VTY lines to check for local login credentials and allow only
incoming SSH sessions.
5 Verify this part of the configuration using the appropriate show commands
and save the configuration.
6 Configure the correct default gateway on the admin PC and try to log in to
the routers from the admin PC using SSH.
Run the command ssh -l <username> <target-ip>
7 Go to the Command Prompt in the admin PC and try to ping CEO1 and
Employee1.
8 Go to the Command Prompt in Employee2's PC and try to ping
Copyrighter1 and Dialer1. The results should be successful. If a connectivity
test fails, perform troubleshooting.
Note: If this is your first time pinging the Dialer1 or Copyrighter1 PC from
Employee 2's PC, the first ping may fail since the ARP tables are not
populated. The first ping will aid in populating the ARP tables in the
network devices, and future pings should then work.

Network Edge
 End System
 End system are also referred to as host because they host (ie, run)
application program such as a web browser program, a web server
By Deep Raj Bhujel Page 16
[Link]
program, an email reader program. m
 Host are further divided into two categories:
 Clients
 Servers
 Informally, clients tend to be desktop and mobile pc‘s and so on, whereas
servers tend to be more powerful machine that stores and distribute web
pages, stream video so on.
 Clients and Servers
 A client is a program running on one end system that requests and receive
a service from a server running on other end system.
 Not all internet applications are client-server model, they are also peer-
to-peer model like Bit Torrent and eMute.

Network Core

 It means the approach to moving data through a network of links and switches.
 There are two types:
 Circuit Switching
 Packet Switching
 In circuit switched network, the resources needed along a path (buffer, link
transmission rate) to provide for communication between the end systems are
reserved for the duration of the communication session between the end
systems.
 It reserves a constant transmission rate in the network‘s links for the duration
of the communication. Since bandwidth has been reserved for this sender-to-
receiver. Connection, the sender can transfer the data to the receiver at the
guaranteed constant rate.
 In packed switched network, the resources are not reserved for a sessions
message use the resources on demand, and as a consequence may have to
wait (i.e. queue) for access to a communication link.
 The packet is sent into the network without reserving and bandwidth if one of
the links is busy because other packets need to be transmitted over the link at
the same time, our packet will have to wait in a buffer at the sending side of
the transmission link, and suffer a delay.
There are two approaches in packet switched network
1. Datagram Network
 Any network that forwards the packets according to the destination address is called a
datagram network.
By Deep Raj Bhujel Page 17
[Link]
 The routers in the internet forwards packets according to themdestination address.
Hence, internet is datagram network.
2. Virtual Circuit Network
 Any network that forwards the packets according to virtual circuit identifier (fixed
route) is called a virtual circuit network.
 Preplanned route established before packets sent.

By Deep Raj Bhujel Page 18


[Link]
 Examples are X25, Frame relay, ATM technologies. m

Network Access
1. Dial-Up
 Accessing the internet over ordinary analog telephone lines using a dial-up modem.
 The term ―dial-up‖ is used because the user software actually dials an ISP‘s
phone number and makes a traditional phone connection with the ISP.
 Two major drawbacks:
 Extremely slow, maximum 50 kbps.
 Cannot use phone line while accessing internet.
2. DSL (Digital Subscriber Line)
 DSL internet is accessed from the same company that provides it wired local phone access.

 Advantages:
a) High data rate (download 1-2 mbps, upload 128 kbps-1mbps)
b) Users can simultaneously talk on the phone and access internet.
1) Cable
 Cable internet access make the use of cable TV company‘s existing infrastructure
 Both the fiber and co-axial cable are employed, it is also called hybrid fiber coax (HFC)
 Requires cable modem, which connects to the home PC through Ethernet port.
2) Wireless Network
 Wireless LAN (Wi-
Fi) IEEE 802.11
 Wide Area Wireless Access eg:- 3G,GPRS.
 WiMAX
 Intel WiMAX 2009
 k/a IEEE 802.16 is a long distance derivation of the 802.11 WiFi protocol

By Deep Raj Bhujel Page 19


[Link]
speed 5-10 Mbps. m

Physical Media
1. Guided Media

By Deep Raj Bhujel Page 20


[Link]
The waves are guided along a solid medium. m
a) Twisted Pair Cable
b) Coaxial Cable
c) Optical Fiber

a) Twisted Pair Cable


It consists of two insulated strands (each about 1mm thick) of copper wire twisted
around each other to form a pair. One or more twisted pairs are used in it. The
purpose of twisting is to eliminate electrical interference from the wires and cancels
any noises from the adjacent pair. The more twist per linear foot, the greater the
effect.
There are two types:
i. SIP (Shielded Twisted Pair)
 Has a foil or a wire braid wrapped around the individual wires of the pair.
 Minimizes EMI radiation.

ii. UTP (Unshielded Twisted Pair)


No shielding and is more victim of EMI but is the most frequently used
because it is inexpensive and easier to install.

b) Coaxial Cable
It is made of two conductors that share the same axis, the centre is a copper wire
that is insulated by a plastic coating and then wrapped with an outer conductor
(usually a wire braid).

There are two types:


i. Thick Net
 0.38 inch in diameter
 Also called 10b5 cable, which means speed 10 and signal can be strong up to 500m.
ii. Thin Net
 0.25 inch in diameter.
 Similar to the material commonly used in cable TV.

By Deep Raj Bhujel Page 21


[Link]
 Also called 10b2 cable, means 10 mbps and can carry upm
to 200 m before being
weak.

c) Optical Fiber
- A thin, flexible medium that conducts pulses of light, with each pulse
representing a bit.
- Can support high bit rates, up to Gbps, immune to EMI, has very low signal
attenuation up to 100 km
- Standard is optical carrier (OC), ranges from 51.8 Mbps to39.8 Gbps.

By Deep Raj Bhujel Page 22


[Link]
m are available.
- Oc-1, oc-3, oc-12, oc-24, oc-48, oc-96, oc-192, oc-768
- Oc-n, where the link speed equals n*51.8 Mbps.
There are two types:
i. Single Mode (Mono Mode)
For longer distance and LASER is used as light source.
ii. Multi Mode
For shorter distance and LED is used as light source.

2. Unguided Media
The waves propagate in the atmosphere and in outer space, such as in a
wireless LAN or a digital satellite channel.
a) Terrestrial Radio Channel
b) Satellite Radio Channel
a) Terrestrial Radio Channel
 Carry signals in the electromagnetic spectrum.
 No need of physical wire to be installed, can penetrate walls, provide
connectivity to mobile user, and potentially carry a signal for long
distances.
 May face
 Path loss
 Shadow fading(which decrease the signal strength as signal travels over a distance
and around/through obstructing objects)
 Multiple fading (due to signal reflection off of interfering objects)
 E.g. wireless LAN, cellular access technology.
b) Satellite Radio Channels
 Links two or more Earth-based microwave transmitter/receiver known as ground
stations.
 Satellite receives transmissions on one frequency band, regenerates the
signal using a repeater, and transmits the signal on another frequency.
 Two types:
i. Geostationary Satellite
- Permanently remain above the same spot on Earth at 36,000 km above surface.
- Propagate delay of 280 ms.
ii. Low Earth Orbiting (LEO) satellite
- Placed much closer to Earth and do not remain permanently above one spot on Earth.
- Rotate around Earth and may communicate with each other as well as with ground
stations.
- For continuous coverage, may satellites need to be placed.

By Deep Raj Bhujel Page 23


[Link]
m
1.1 Protocol Layers
Protocol
In computer science and telecommunications, a communication protocol is a system
of digital rules for data exchange within or between computers. When data is
exchanged through computer network, the rule system is called a network protocol.
Protocol Layer
In software and hardware environment of two or more communication devices or
computers in which a particular network protocol operates. A network protocol may
be thought of as a set of more or less independent protocols, each in a different layer
or level. The lowest layer governs direct host-to-host communication between the
hardware at different hosts; the highest consists of user application programs. Each
layer uses the layer beneath it and provides a service for the layer above. Each
networking components hardware or software on one host uses protocols
appropriate to its layer to communicate with the corresponding component on
another host.
Layered Architecture

Application
Application
Presentation
Session
Transport Transport
Network Internet
Data link
Network Access
Physical
OSI Model
TCP/IP Model
A reference model (OSI and TCP/IP) is a conceptual rule of how communications
should take place. It addresses all the processes required for effective
communication and divides these processes into logical groupings called layers.
When a communication system is designed in this manner, it is known as layered
architecture.
Need of Layered Architecture
 It divides the network communication process into smaller and simpler
components, thus aiding component development, design and
troubleshooting.
 It allows multi-vendor development through standardization of network components.
 It allows different various types of network software and hardware to communicate.

By Deep Raj Bhujel Page 24


[Link]
m
OSI Model (Open System Inter Connection)

Layer 7 Application  Provides a user interface


Layer 6 Presentation  Presents data
 Handles processing such as encryption/decryption
Layer 5 Session  Keeps different applications data separate
Layer 4 Transport  Provides reliable or unreliable delivery
 Performs error correction before retransmit

By Deep Raj Bhujel Page 25


[Link]
Layer 3 Network m
 Provides logical addressing, which routes use for path
determination
Layer 2 Data Link  Combines packets into bytes provides access to media
using MAC address performs error detection, not
correction.
Layer 1 Physical  Specifies voltage wire speed and pin-out of cables.

TCP/IP (Transmission Control Protocol/IP) Model

Application Process (FTP, SMTP

Transport Transport

Internet Internet

Network Access Network Access

OSI Layers

Layer 7 Application
Layer 6 Presentation
Layer 5 Session
Layer 4 Transport
Layer 3 Network
Layer 2 Data Link
Layer 1 Physical
Layer 7: Application
This is the layer that actually interacts with the operating system or application
whenever the uses to transfer files, read messages or perform other network-
related activities.
Layer 6: Presentation
Layer 6 takes the data provided by the Application layer and converts it into
standard format that other layers can understand.
Layer 5: Session
Layer 5 establishes, maintains and ends communication with the receiving device.
Layer 4: Transport
This layer maintains flow control of data and provides for error-checking and
By Deep Raj Bhujel Page 26
[Link]
recovery of data between the devices. Flow control meansm that the Transport
layer looks to see if data is coming from more than one application and
integrates each applications data into a single stream for the physical network.
Layer 3: network

By Deep Raj Bhujel Page 27


[Link]
m
The way that the data will be sent to the recipient device is determined in this
layer. Logical protocols, routing and addressing are handled here.
Layer 2: Data Link
In this layer, the appropriate physical protocol is assigned to data. Also, the
type of network and the packet sequencing is defined.
Layer 1: Physical
This is the level of the actual hardware. It defines the physical characteristics
of the network such as connections, voltage levels and timing.

TCP/IP Layer
Layer 4: Application Layer
This layer defines TCP/IP application protocols and how host programs
interface with Transport layer services use the network.
Layer 3: Transport Layer
The purpose of this device is to permit devices on the source and destination
hosts to carry on a conversation. It defines the level of service and status of the
connection used when transporting data.
Layer 2: Internet Layer
This layer packs data into data packets known as IP datagram, which contain
source and destination address (IP address) information that is used to
forward the datagram between hosts and across networks.
Layer 1: Network Access Layer
This layer defines details of how data is physically sent or optically signaled by
hardware devices that interface directly with a network medium, such as co-
axial cable, optical fiber or twisted pair, copper wire.

Data Encapsulation and De-encapsulation


 When a host transmits data across a network to another device, the data goes
through encapsulation.
 At the receiving device, the data goes through de-encapsulation.
Layer Addressing

By Deep Raj Bhujel Page 28


[Link]
m

Fig: Data encapsulation

Fig: PDU and Layered Addressing


At a transmitting side, the data encapsulation method works like this:
1. User information is converted to data for transmission on the network.
2. Data is converted to segments and a reliable connection is set up between the
transmitting and receiving hosts.
3. Segments are converted to packets or data grams, and a logical address is placed in
the header so each packet can be routed through the internetwork.
4. Packets or datagram are converted to frames for transmission on the local network.
Hardware (Ethernet) addresses are used to uniquely identify hosts on a local
network segment.
5. Frames are converted to bits, and a digital encoding and clocking scheme is used.

Network Entities
Hub
 It is a device for connecting multiple devices together and making them
By Deep Raj Bhujel Page 29
[Link]
act as a single network segment. m

By Deep Raj Bhujel Page 30


[Link]
 It has multiple I/O ports, in which a signal introduced at the m
input of any port
appears at the output of every port except the original incoming.
 Doesn‘t examine or manage any or the traffic that comes through it, any
packet entering any port is rebroadcast on all other ports.
Switch
 Device used to connect devices together on a computer network.
 A switch is considered more advanced than hub because a switch will only
send a message to the device that need or requests it rather than broadcasting
the same message out of each of its ports.
Router
 A device that forwards data packets between computer network creating an
overlay internetwork.
 It is connected to two or more data links from different network.
 When a data packet comes in one of the lines, the router reads the address
information in the packet to determine its ultimate destination.
Bridge
 It is a network device which connects two or more LANs.
Repeater
 It is an electronic device that receives a signal and retransmits it at a higher
level or higher power, and onto the other side of an abstraction, so that the
signal can cover long distances.
 In telecommunication, the term repeater has the following standardized meanings.
1. An analog device that amplifies as input signal regardless of its nature.
2. A digital device that amplifies, reshapes, retimes or performs a combination of any
of these functions on a digital input signal for retransmission.

By Deep Raj Bhujel Page 31


[Link]
1.2 ApplicationmLayer

Web: File E-mail: Remote Network Name


HTTP Transfer: SMPT, POP3, login: Management: Management:
FTP IMAP TELNET SNMP, NFS, DNS
TFTP

The web and HTTP


Hypertext transfer protocol (HTTP) works with the world wide web(WWW) which is
the fastest growing and most used part of the internet. It is popular because of the
ease with which it allows access to information. A web browser is a client-server
application, which means that it requires both a client and a server component in
order to function. A web browser presents data in multimedia formats on the web
pages that use text, graphics, sound and video. The web pages are created with a
format language called hypertext Markup language (HTML). HTML directs a web
browser on a particular web page to produce the appearance of the page in a specific
manner. In addition HTML specifies locations for the placement of text, files and
objects that are to be transferred from the web server to the web browser.
Hyper links make the World Wide Web easy to navigate. A hyper link is a object,
world phrase or picture on a webpage. When that hyperlink is clicked it directs the
browser to a new webpage. The webpage contains an address location known as a
uniform resource locator (URL).
In the URL, [Link] here the http:// tells the
browser which protocol do we use. The second part ―www‖ is the host name or a
name of a specific machine with a specific IP address. The last part ―/pictures/‖
identifies the specific folder, location on the server that contains the default web
page.
A web browser usually opens to a starting or home page. The URL of the homepage,
has already been stored in a configuration are of the web browser and can be
changed at any time. From the starting page, click on one of the webpage hyperlinks
or type a URL in the address bar of the browser. The web browser examines the
protocol to determine, if it needs to open the other program and then determines
the IP address of the web browser using DNS. Then transport layer, network layer,
data link layer and physical layer work together to initiate a session with the server
contains the folder name of the webpage location. The data can also contain a
specific file name for HTML page. If no name is given then the default name as
specified in the configuration on the server is used.
The server response to the request by sending to the web client all of the text, audio,
By Deep Raj Bhujel Page 32
[Link]
video and graphic files specified in the HTML instructions. The m client browser
reassembles all the files to create a view of the webpage and then terminates the
session. If another page that is located on the same or different server is clicked the
whole process begins again.
HTTP Message format
i) HTTP request message format

By Deep Raj Bhujel Page 33


[Link]
m

Fig: General format of an HTTP request


message Below we provide a typical HTTP request message:
GET: /somedir/[Link]
HTTP/1.1 HOST:
[Link]
Connection: close
User-agent:
Mozilla/4.0 Accept-
language: fr
 Message consists of five lines (may be more), each followed by a carriage
return (cr) and line feed (lf)
 First line is called request line, the subsequent lines are called the header lines.
 The request line has 3 fields.
i) The method field
 GET –to browse a particular website
 POST –to search with keywords (entity body is not empty)
 HEAD –requests a HTTP message but leaves out the requested object.
Application developers
 PUT –used with web publishing tools to upload objects.
 DELETE –to delete an object on a web server.
ii) URL field
 -/somedir/[Link].
iii) the HTTP version field
 -HTTP/1.1 is the version 1.1 of HTTP.
 Let‘s look at the header lines
 Host: [Link] specifies the host on which the object resides.
 Connection: close is telling the server to close the connection after sending the
By Deep Raj Bhujel Page 34
[Link]
requesting object. m
 User-agent: specifies the browser type.
 Accept-language: fr indicates that the user prefers to receive. French version of the
object, if exists on the server, otherwise the server should sent its default version.
ii) HTTP Response Message Format

By Deep Raj Bhujel Page 35


[Link]
m

Fig: General format of HTTP response message.


Consists of two parts:
i) Status line
ii) Header Lines
The status line has 3 sections
 The protocol version field.
 The status code.
 Corresponding status message.
A few details about status code and their phrases
200 OK – request succeeded and the information is returned in response.
301 Moved permanently – requested object has been permanently moved, the
new URL specified in location: header of the response message.
400 Bad Request – This is a generic code indicating that the request could not be
understood by the server.
404 Not Found – The requested document doesn‘t exist on the server.
505 HTTP Version Not Supported – The requested HTTP protocol version is not supported by
the server.

Example:
HTTP/1.1 200 OK
Connection: close
Date: Sun, 09 Mar 2014 09:45 GMT
Server: Apache/1.3.0 (UNIX)
Last–modified: Fri, 6 Jan 2014 [Link] GMT
Content-length: 6978
Content-Type:
text/html

By Deep Raj Bhujel Page 36


[Link]
m
Connection: Close
 To tell the client that it is going to close the TCP connection after sending the
message. Date:
 Indicates the time and date when the HTTP response was created and sent by the server.

By Deep Raj Bhujel Page 37


[Link]
Server: m
 Indicates that the message was generated by an Apache web
server. Last-modified:
 Indicates the time and date when the object was created or last
modified. Content-Length:
 Indicates the number of bytes in the object being
sent. Content-Type:
 Indicates that the object in the entity body is HTML text.

Cookies
 As HTTP server is stateless, web servers can handle thousands of simultaneous
TCP connections.
 It is often desirable for a website to identify users, either because the server
wishes to restrict user access or because it wants to serve content as a
function of the user identify.
 For the purpose, HTTP user cookies, which allow sites to keep track of users.
 Cookie technology has four components.
 A cookie header line in the HTTP response message.
 A cookie header line in the HTTP request message.
 A cookie file kept on the user‘s end system and managed by the user‘s browser.
 A back-end database at the website.
 In the HTTP response message,
 Set cookie : 1783
 In the HTTP request message.
Cookie: 1783

FTP (File Transfer Protocol)


FTP is reliable, connection-oriented service that uses TCP to transfer files between
systems that support FTP. The main purpose of FTP is to transfer files form one
computer to another by copying and moving files from servers to clients, and from
clients to servers. When files are copied from a server, FTP first establishes a Control
Connection between the client and the server. Then, a second connection is
established, which is a link between the computers through which data is
transferred. Data transfer can occur in ASCII mode or in binary mode. These modes
determine the encoding used for data file, which in the OSI model is a presentation
layer task. After the file transfer has ended, the data connection terminates
automatically when the entire session of copying and moving files is complete, the
command link is closed when the user logs off and ends the session.
By Deep Raj Bhujel Page 38
[Link]
m

By Deep Raj Bhujel Page 39


[Link]
Fig: Control and data connections m
Client
 Initiates a control TCP connection.
 Sends the user identification and password over the control connection.
 Also sends over the control connection, commands to change the remote directory.
Server
 When a request receives, FTP server starts TCP data connection.
 Sends exactly one file over the data connection and then closes the data connection.
 FTP data connection opens again for another data transfer.
 Non-persistent connection.

FTP Commands and Replies


 Each successive command follows CR and LF.
 Each command consists of fur uppercase ASCII characters, some with optional arguments.
 Some of the more common commands are given below :
 USER username: used to send the user identification to the server.
 PASS password: used to send the user password to the server.
 LIST: used to ask the server to send back a list of all the files in the current remote
directory. The list of files is sent over a (new and non-persistent) data connection rather
than the control TCP connection.
 RETR filename: used to retrieve (i.e., get) a file from the current directory of the remote
host.
 STOR filename: used to store (i.e., put) a file into the current directory of the remote
host.
 Each command is followed by a reply, sent from server to client.
 The replies are 3-digit numbers, with an optional message following the number.
 Similar in structure to the status code and phrase in the status line of the HTTP
response message.
 Some typical relies, along with their possible messages, are as follow :
 331 username ok, password required
 125 data connection already open, transfer starting
 425 can‘t open data connection
 452 error writing file.

DNS (Domain Name System)


 DNS is
 A distributed database implemented in a hierarchy of DNS servers.
 An application layer protocol that allows hosts to query the distributed database.
 DNS protocol runs over UDP and users port 53.
 DNS is commonly employed by other application-layer protocols including
By Deep Raj Bhujel Page 40
[Link]
HTTP, SMTP and FTP to translate user supplied hosts namesmto IP addresses.

Mail Server Aliasing


- Permits Company‘s mail server and web server to have identical (aliased) hostnames.

By Deep Raj Bhujel Page 41


[Link]
- E.g. [Link]: for mail server and for web server also. m
- Load distribution
 Busy sites are replicated over multiple servers. With each server running on a
different end system and each having a different IP address.
 For replicated web servers, a set of IP address is thus associated with
one canonical hostname.

Working Of DNS:
 In order of the user‘s host to be able to send on HTTP request message to the
web server [Link] , the user‘s host must first obtain the IP
address of [Link] . This is done as follows :
i) The same user machine runs the client side of the DNS application.
ii) The browser extracts the host name [Link] from the URL and passes
the host name to the client site of the DNS application.
iii) The DNS client sends a query containing the host name to a DNS server.
iv) The DNS client eventually receives a reply which includes the IP address for the host
name.
v) Once the browser receives the IP address from DNS, it can initiate a TCP connection
to the HTTP server located at port 89 at that IP address. A simple design for DNS
world has one DNS server that contains all the mappings. In the centralized design.
Clients simply direct all queries to the single DNS server and the DNS server
responds directly to the querying clients. The problem with a centralized design
include :
 A single point of failure
If the DNS server crashes, so does the entire internet.
 Traffic volume
A single DNS server would have to handle all DNS queries.
 Distant centralized database:
A single DNS server cannot be close to all the querying clients. If we put
the single DNS server in US, then all queries from Australia must travel
to the other side of the globe, perhaps over slow and congested links.
This kind leads to significant delays.
 Maintenance
The single DNS server would have to keep records for all internet hosts.
Not only would this centralized database be huge, but it would have to
be updated frequently to account for every new host.

A distributed, Hierarchical database


3 classes of DNS servers:

By Deep Raj Bhujel Page 42


[Link]
i) Root DNS server m
ii) Top-level domain (TLD) DNS servers.
iii) Authoritative DNS servers.

By Deep Raj Bhujel Page 43


[Link]
m

There is another important type of DNS server called the local DNS server.

DNS Records
The DNS servers that together implement the DNS distributed database store
resource records (RRs), including RRs that provide hostname to IP address mappings.

By Deep Raj Bhujel Page 44


[Link]
Each DNS replay message carries one or more resource records. m

By Deep Raj Bhujel Page 45


[Link]
A resource record is a four tuple that contains the following m
fields. (Name, Value, Type, TTL)
TTL is the time to live of the resource record; it determines when a resource should
be removed from a cache. In example, we ignore the TTL field. The meaning of Name
and Value depend on Type.
There are 5 types of DNS records: A, CNAME, NS, MX and PTR
i) Type =A
Address (A) records direct a hostname to a numerical IP address. For eg, if
you want [Link] to point to IP (which is for e.g. [Link])
you would enter a record that looks like ([Link], [Link],
A)
ii) Type= CNAME
Canonical name (CNAME) allows a machine to be known by one or
more host names. There must be always an A record first, and this is
known as canonical name or official name. For e.g.:
([Link],[Link],A)
Using CNAME, you can point other hostnames to the canonical (A
record) address. For example:
([Link], [Link], CNAME)
([Link], [Link], CNAME)
([Link], [Link], CNAME)
iii) Type=NS
Name server (NS) records specify the authoritative name servers for
the domain. For e.g.: [Link], [Link], NS)
Authoritative server
iv) Type = MX
Mail exchangers (MX) records serve the purpose of using mail server
through its web server i.e., canonical name.
For e.g.: ([Link], [Link], MX)
Mail server
v) Type=PTR
Pointer (PTR) records are used for reverse lookups. For e.g.: to make
[Link] resolve the [Link] the record would look like
([Link].in [Link], [Link], PTR)

DNS Message (Query and Reply)


Identification Flags
Number of questions Number of answer RRs
Number of Authority RRs Number of Addition RRs
By Deep Raj Bhujel Page 46
[Link]
Questions m
Variable number of questions
Answers
Variable number of Resource Records (RRs)
Authority
Additional Information
Fig: DNS message Format
 The first 12 bytes is the header section which has a number of fields. The first field is a
16-bit number that identifies the query. This identifier is copied into the reply message
to

By Deep Raj Bhujel Page 47


[Link]
a query allowing the client to match received replies m with sent queries.
There are a number of flags in the flag field. A 1 bit query/reply flag
indicates whether the message is a query (0) or a reply (1). A 1-bit
authoritative flag is set in a reply message when a DNS server is an
authoritative server for a queried name. A 1-bit recursion-desired flag is set
when a client (host or DNS server) desires that the DNS server perform
recursion when it doesn‘t have the record. A 1-bit recursion available field
is set in a reply if the DNS server supports recursion. In the header, there
are also four numbers of fields. These fields indicate the number of
occurrences of the four types of data sections that follow the header.
 The question section contains information about the query that is being made. This
section includes
a) A name field that contains the name that is being queried.
b) A type field that indicates the type of question being asked about the names for
e.g. a host address associated with a name (Type A) or the mail server for the
name (Type MX)
 In a reply form a DNS server the answer section contains the resource records for the
name that was originally queried. Recall that in each resource record there is the Type
(for e.g.: A, NS, CNAME, or MX), the value and the TTL. A reply can return multiple RRs in
the answer.
 Since a hostname can have multiple IP addresses (for e.g. for replicated web servers, as
discussed earlier in the section). The authority section contains records of other
authoritative servers.
 The additional section contains other helpful records. For eg : the answer field in a reply
to an MX query contains a resource record providing the canonical hostname of a mail
server. The additional section contains a Type A record providing the IP address for the
canonical hostname of the mail server.

By Deep Raj Bhujel Page 48


[Link]
m
1.3 Transport Layer
The primary duties of the transport layer are to transport and regulate the flow of
information from a source to a destination, reliably and accurately. End-to-end
control and reliability are provided by sliding windows, sequencing numbers and
acknowledgements.
To understand reliability and flow control think of someone who studies a foreign
language for one year and then visits the country where the language is used. In
conversation, words must be repeated for the reliability. People must also speak
slowly that the conversation is understood, which relates to flow control.
The transport layer establishes a logical connection between two end points of a
network. Protocols in transport layer segment and reassemble data sent by upper
layer applications into the same transport layer data string. This transport layer data
string provides end-to-end transport services.
Functions:
 Error handling
 Flow control
 Multiplexing
 Connection set-up and release
 Segmentation and reassembly
 Addressing (Port addressing)
Services
 Unreliable unordered unicast or multicast delivery (UDP)
 Reliable, in-order unicast delivery (TCP)

Connectionless Transport: UDP (User Datagram Protocol)


UDP is the connectionless transport protocol in the TCP/IP protocol stack. UDP is a
simple protocol that exchanges datagram without guaranteed delivery. It relies on
higher layer protocols to handle error and retransmit data.
UDP doesn‘t use window or Asks reliability is provided by application layer protocols.
UDP is designed for applications that do not need to put sequence of segments
together.
The following application layer protocols use UDP: TFTP, SNMP, DHCP, and
DNS Hence,
 Used in transport layer
 Offers unreliable connectionless service
 Provides faster service than that of TCP.
 Offers minimum error checking mechanism.
 Supports multicasting because connectionless.
 Offers minimum flow control mechanism.
By Deep Raj Bhujel Page 49
[Link]
 Also used by SNMP (Simple Network Management Protocol) m

UDP Segment Structure:


Source port number (16) Destination port number (16)
UDP segment length (16) UDP checksum (16)
Data

By Deep Raj Bhujel Page 50


[Link]
 Source port – number of the port that sends data. m
 Destination port – Number of the port that receives data.
 Length – calculated of bytes in header and data.
 Checksum – calculated checksum of the header and data field.
 Data – upper-layer protocol data.

Connection–Oriented Transport: TCP (Transmission Control Protocol)


TCP is a connection-oriented transport layer protocol that provides reliable full-
duplex data transmission. TCP is port of the TCP/IP protocol stack. In a connection-
oriented environment a connection is established between both ends before the
transfer of information can begin. TCP breaks messages into segments, reassembles
them at the destination and resends anything that is not received. TCP supplies a
virtual circuit between end user applications:
The following application layer protocols use TCP, FTP, HTTP, SMTP and Telnet. Hence
 This is a real protocol which runs in transport layer.
 It offers reliable connection-oriented service between source and destination.
 It acts as if it is connecting two end points together, so that it is a point-to-
point connection between two parties.
 It doesn‘t support multicasting (because it is connection oriented)
 The data in TCP is called a segment.
 Segments are obtained after breaking big files into small pieces.
 It assists in flow control.
 It provides buffer to each connection.

TCP segment Structure


Source port (16) Destination port (16)
Sequence number (32)
Acknowledgement Number (32)
Header length (4) Reserved (4) code bits (6) window site (16)
Checksum (16) Urgent Pointer (16)
Options (0 or 32 if any)
Data

Source port – Number of the port that sends data.


Destination port – Number of the port that receives data.
Sequence number – Number used to ensure the data arrives in the correct order.
Acknowledgement number – next expected TCP octet (defines the number of next byte, a
party, expects to receive)
Header length – length of TCP header.
Reserved – reserved for future use.
By Deep Raj Bhujel Page 51
[Link]
Code bits – control functions such as setup and termination of a session.
m

U A P R S F

U -urgent valid
A –acknowledges received data

By Deep Raj Bhujel Page 52


[Link]
P –data push is valid m
R –reset valid
S –synchronization valid (initiates a
connection) F –final valid (terminates a
connection)
Window size - number of octets (bytes) that a receiver is willing to accept.
Checksum – indicates the end of the urgent data.
Option – used when sender and receiver negotiate the maximum segment size.
Data – upper-layer protocol data.

Roundtrip Time (RTT) Estimation And Timeout

Sender receiver

 RTT, also called round trip delay is the time required for a signal pulse or
packet to travel from a specific source to a specific destination and back again.
 The sample RRT, denoted as sample RTT, for a segment is the amount of time
between when the segment is sent and when an acknowledgement for the
segment is received.
 Obviously, the sample RRT values will fluctuate from segment to segment due
to congestion in the routers and to the varying loads on the end systems.
 In order to estimate a typical RTT, it is natural to take some sort of average
of the sample RTT values, called Estimated RRT as
Estimated RRT = (1-x)*estimated RRT + x*sample RRT
Where x=0.125 recommended.
 Hence, the new value of estimated RRT is a weighted combination of the
previous value of estimated RRT.
 This weighted average puts more weight on recent samples than the old
samples. This is natural, as the more recent samples better reflect the current
By Deep Raj Bhujel Page 53
[Link]
congestion in the network. In statistics, such an average ismcalled exponential
weighted moving average (EWMA).
 In addition to having an estimate of the RTT, it is valuable to have a measure
of the variability of the RTT, called DevRTT an estimate of how much sample
RRT typically deviates from estimated RRT.
DevRTT = (1-y)*DevRTT+y*|sampleRTT-Estimated
RTT| Where y=0.25 recommended.
Note that, DevRTT is an EWMA of the difference between sample RTT and estimated
RTT, if the sample RTT values have little fluctuation, then Dev RTT will be small and
vice versa.

Setting and Managing The Retransmission Timeout Interval

By Deep Raj Bhujel Page 54


[Link]
Given the values of EstimatedRTT and DevRTT, what value shouldmbe used for TCP‘s
timeout interval? Clearly, the interval should be greater than or equal to
EstimatedRTT, or unnecessary retransmissions would be sent. But the timeout
interval should not be much larger than Estimated RTT; otherwise when a segment is
lost, TCP would not quickly retransmit the segment, leading to large data transfer
delays. It is therefore desirable to set the timeout equal to the EstimatedRTT plus
some margin. The margin should be large when there is a lot of fluctuation in the
sample RTT values, it should be small when there is little fluctuation. The value of
DevRTT should thus come into play here:
Timeout Interval = estimated RTT + 4 * Dev RTT

Multiplexing and De-multiplexing

Fig.: Multiplexing and De-multiplexing


 Extending the host-to-host delivery service provided by the network layer to a
process-to- process delivery service application running on the hosts.
 Consider how a receiving host directs on incoming transport layer segment to
the appropriate socket. Each transport layer segments has a set of fields for
this purpose. At the receiving end, the transport layer examines these fields to
identify the receiving socket and then it directs the segment to that socket.
The job of delivering the data in the transport layer segment to the correct
socket is called de-multiplexing. The job of gathering data chunks at the source
host from the different sockets, encapsulating each data chunk with the
header information to create segments and passing the segments to the
network layer is called multiplexing.

Flow Control
By Deep Raj Bhujel Page 55
[Link]
A TCP connection sets aside a receiver buffer for the connection. m When the TCP
connection receives bytes that are correct and in sequence, it places the data in the
receiver buffer. The associated application process will read data from this buffer,
but not necessarily at this instant the data arrives. Indeed, the receiving application
may be busy with some other task and may not attempt to read the data until longer
after it has arrived. If the application is relatively slow at reading data the sender can
very easily overflow the receive buffer by sending too much data quickly.

By Deep Raj Bhujel Page 56


[Link]
m possibility of the
TCP provides a flow control service to its application to estimate the
sender overflowing the receive buffer. Flow control is thus a speed-matching service
matching the rate at which the sender is sending against the rate at which receiving
application is receiving.

Congestion
When too many packets are present in a subnet or a part of subnet, performance
degrades. This situation is called congestion. When number of packets dumped into
the subnet by the hosts is within its carrying capacity, they are all delivered (except
for a few that contain transmission errors), and the number delivered is proportional
to the number sent. However, as traffic increases too far, the routers are no longer
able to cope, and they begin losing packets. At very high traffics, performance
collapses completely and almost no packets are delivered.
Causes of Congestion
 When there are more input lines and less or single output lines.
 When there is slow router i.e., if routers CPU‘s, are slow
 If the router has no free buffers i.e., insufficient memory to hold queue of packets.
 If the components used in subnet (link, router, switches, etc) have different
traffics carrying and switching capacities, then congestion occurs.
 If the bandwidths of the lines are low, it can‘t carry large volume of
packets and caused congestion. Hence, congestion cannot be eradicated but
can be controlled.

Congestion Control Algorithms


i) Leaky Bucket Algorithm
ii) Token Bucket Algorithm
iii) Choke Bucket Algorithm

Leaky Bucket Algorithm

By Deep Raj Bhujel Page 57


[Link]
m

Imagine a bucket with a small hole in the bottom. No matter at what rate water
enters the bucket, the outflow is at constant rate, when there is any water in the
bucket and zero when the bucket is empty. Also once the bucket is full any additional
water entering it spills over the sides and is lost.

By Deep Raj Bhujel Page 58


[Link]
The same idea can be applied to the packets conceptually; each host m is connected to
the network by an interface, containing a leaky bucket, i.e. finite interval queue. If a
packet arrives at the queue when it is full, the packet is discarded if one or more
processes within the host try to send a packet when a maximum number are already
is queue, the new packet is discarded.

Token Bucket Algorithm

A leaky bucket algorithm is based on the rigid output pattern at the average rate no
matter how bursty the traffic is. In leaky bucket, there are chances of loss of packet
as packet is filled in bucket and overflow if bucket is full. To minimize such limitation
of bucket, token bucket algorithm was introduced.
The bucket holds token, not packet. Tokens are generated by clock at the rate of one token
per
T sec. for a packet to be transmitted; it must capture and destroy one token. Token
bucket algorithm allows saving up permission to bucket as leaky bucket doesn‘t
allow. This property means that bursts of packets can be sent at once allowing some
burstness at output stream and giving faster response to sudden bursts of input.
Another difference between token bucket and leaky bucket is that the token bucket
throws away token when the bucket fills up but never discards packets. In token
bucket also allows sending bytes basis, for variable size packets. A packet can only be
transmitted if enough token are available to cover its length in bytes fractional
tokens are kept for further use.
The implementation of basic token bucket algorithm is just a variable counts tokens.
The counter is incremented by one at every T sec and decremented by one
whenever one packet is sent. When counter hits zero, no packet can be sent.
By Deep Raj Bhujel Page 59
[Link]
m
Reliable Data Transfer (RDT)
RDT is the mechanism where no transferred data bits are corrupted (flipped from o
to 1, or vice versa) or lost, and all are delivered in the order in which they were sent.
TCP creates a RDT service on top of IPs unreliable best effort service.
TCP‘s RDT service ensures that the data stream that a process reads out of its TCP
receive buffer is uncorrupted, without gaps, without duplication and in sequence,
that is, the byte stream is exactly the same byte stream that was sent by the end
system on toe other side of the connection.

By Deep Raj Bhujel Page 60


[Link]
m
Building a RDT protocol
1) Reliable Data transfer over a Perfectly Reliable Channel
 We first consider the simplest case, in which the underlying channel is
completely reliable.
 It is called finite-state machine (FSM).
2) Reliable Data Transfer over a channel with Bit Errors
 A more realistic model of underlying channel is one in which bits in a
packet may be corrupted.
 If receiver receives the packet, the receiver must acknowledge it to the
sender whether the packet has received with error-free or not through
these:
Positive Acknowledgement (ACK)
Negative Acknowledgement (NAK)
 If NAK provided, the sender should retransmit the packet.
 Such protocol is called ARQ (Automatic Repeat Request) protocols.
 Fundamentally, three additional protocol capabilities are required in ARQ
protocols to handle the presence of bit errors :
 Error Detection
 Internet checksum field
 Error-detection and correction techniques
 Require extra bits (beyond the bits of original data to be transferred) to
be sent from the sender to the receiver, these bits will be gathered into
the packet checksum field.
 Receiver Feed Back
 Receiver provides feed back
 Positive (ACK) -1 value
 Negative (NAK) – 0 values
 Retransmission
 A packet that is received in error at the receiver will be retransmitted by the
sender.
These phenomena are called stop-and-wait protocols.

An amazing case will occur if ACK or NAK is corrupted i.e. the sender could not get
the feedback from sender.
Consider three probabilities for handling corrupted ACKs or NAKs.
 A second alternative is to add enough checksum bits to allow the sender not only to
detect, but also to receiver from bit errors. This solves immediate problem for a channel
By Deep Raj Bhujel Page 61
[Link]
that can corrupt packets but not lose them. m
 A third approach is for the sender simply to resend the current data packet when it
receives a garbled ACK or NAK packet. This introduces duplicate packets into the sender-
to-receiver channel. The receiver doesn‘t know whether the ACK or NAK it last sent was
received correctly at the ender. Thus, it cannot know whether an arriving packet
contains new data or is a retransmission.
 A solution to this problem is to a new field called ―sequence number‖ to the data
packet.
 For this stop-and-wait protocol, a 1-bit sequence number will be ok.
3) Reliable Data Transfer Over A lossy Channel with Bit Errors

By Deep Raj Bhujel Page 62


[Link]
m
 Suppose now that in addition to corrupting bits, the underlying channel can
lose packets as well.
 The sender must get information of packet loss on the way from the
receiver so that the sender can retransmit.
 The sender must clearly wait at least as long as a round-trip delay between
he sender and receiver.
 If ACK is not received within this time, the packet is retransmitted.
 If a packet experiences a particularly large delay, the sender may
retransmit the packet even though neither the data packet nor its ACK
have been lost.
 This introduces the possibility of duplicate data packets in the sender-to-receiver
channel.
 For all this, we can do is retransmit.
 But implementing a time-based retransmission mechanism requires a
―countdown timer‖ that an interrupt the sender after a given amount of
time has expired.
 The sender will thus need to be able to
 Start the timer each time a packet (either a first time packet or a
retransmission) is sent.
 Respond to a timer interrupt (taking appropriate actions)
 Stop the timer.
Checksums: sequence numbers, timers, positive and negative acknowledgement 1 (page 254)

Reliable Data Transfer Protocol


1. Pipelined
2. Go-Back-N(GBN)
3. Selective Repeat (SR)

Pipelined Reliable Data Transfer Protocol:

Fig: stop-and-wait vs. pipelined protocol


Instead of sending a single packet in stop and wait manner, the sender is allowed to

By Deep Raj Bhujel Page 63


[Link]
send multiple packet without waiting for acknowledgements, as m illustrate in fib (b).
fig (b) shows that if the sender is allowed to transmit three packets before having to
wait for acknowledgement the utilization of the sender is essentially tripled. Since
the many in-transmit sender-to-receiver packets can be visualized as a filling a
pipeline, this technique is known as pipelining.

Consequences of pipelined protocol


 Increment in the range of sequence numbers.

By Deep Raj Bhujel Page 64


[Link]
 Sender and receiver have to buffer more than one packet. m
 Range of sequence numbers and the buffering requirements will depend on the manner
in which a data transfer protocol responds to lost, corrupted and overly delayed
packets.

Go-Back-N (GBN):
In a GBN, protocol, the sender is allowed to transmit multiple packets (when
available) without waiting for an acknowledgement but is allowed to have no more
than some maximum allowable number, N, of an un acknowledged packets in the
pipeline.
Figure shows the sender view of range of sequence numbers in a GBN protocol. If we
define base to be the sequence number of the oldest un acknowledge packet and
next sequence num to be the smallest unused sequence numbers (i.e. the sequence
number of the next packet to be sent), then four intervals in the range of sequence
numbers can be identified. Sequence numbers in the interval [o, base-1] correspond
to packets that have already been transmitted and acknowledged. The interval [base,
next sequence-1] corresponds to packets that have been sent but not yet
acknowledged. Sequence numbers in the interval [next sequence, base+N-1] can be
used for packets that can be sent immediately, should data arrive from the upper
layer. Finally, sequence number greater than or equal to base+ N cannot be used
until an unacknowledged packet currently in the pipeline (specifically, the packet
with sequence number base) has been acknowledged.
As suggested by figure, the range of permissible sequence numbers for transmitted
but not yet acknowledged packets can be viewed as a window of size N over the
range of sequence numbers. As the protocol operates, this window slides forward
over the sequence number space. For this reason, N is often referred to as the
window size and the GBN protocol itself as a sliding window protocol.

By Deep Raj Bhujel Page 65


[Link]
m

By Deep Raj Bhujel Page 66


[Link]
m
Selective Repeat (SR):
GBN itself suffers from performance problems. Many packets can be in the pipeline
when the window size and bandwidth-delay product are both large. A single packet
error can thus cause GBN to retransmit a large number of packets, many
unnecessarily. As the probability of channel error increased, the pipeline can become
filled with these unnecessary retransmissions.
As the name suggests, selective- repeat protocols avoid unnecessary retransmissions
by having the sender retransmit only those packets that it suspects were received in
error (i.e., were lost or corrupted) at the receiver. A window size of N will again be
used to limit, the number of outstanding, unacknowledged packets in the pipeline.
However, unlike GBN, the sender will have already received ACKs for some of the
packets in the window.

Fig.: Selective-repeat (SR) sender and receiver views of sequence-number space


The SR receiver will acknowledge a correctly received packet whether or not it is in
order. Out of order packets are buffered until any missing packets (i.e. packets with
lower sequence numbers) are received at which points a batch of packets can be
delivered in order to the upper layer.

By Deep Raj Bhujel Page 67


[Link]
m

By Deep Raj Bhujel Page 68


[Link]
m (Internet layer)
1.4 Network layer
Functions
 Path determination: route taken by packets from source to destination (Routing
Algorithm).
 Forwarding: more packets from router‘s input to appropriate router output.
 Call setup: some n/w architectures require router cell setup along the path before data
flows.
The following protocol operate at the TCP/IP internet layer
i. Internet protocol (IP): IP provides connectionless, best- effort delivery routing of packet.
IP is not concerned with the contents of the packets but looks for a path to the
destination.
ii. Internet control message protocol (ICMP): ICMP Provides control and messaging
capabilities.
iii. Address Resolution Protocol (ARP): ARP determines the data link layer address or MAC
address, for known IP address.
iv. Reverse ARP(RARP): RARP determines the IP address for known MAC address.

Network service model


(Virtual Circuit and Datagram Networks)
It means the characteristics of end to end transport of packets between sending and
receiving end system.
In the sending host, when the transport layer passes a packet to the n/w layer,
specific services that could be provided by the n/w layer include:
 Guaranteed delivery
 Guaranteed delivery with bounded delay.
Furthermore, the following service could be provided to a flow of packets
between a given source and destination:
 In order packet delivery
 Guaranteed minimal bandwidth
 Guaranteed maximum jitter
 Security service.

Virtual Circuit and Datagram Networks


The internet transport layer provides each application a choice between two services
UDP (a connectionless service) or TCP (a connection oriented service). In similar
manner, a network layer can also provide connectionless service (datagram
networks) or connection service (virtual circuit network)
Although these transport layer and network layer service models seem parallel, there
are some crucial differences:
i. In transport layer, it is process to process service. But, in network layer, it host to host
By Deep Raj Bhujel Page 69
[Link]
service. m
ii. In all computer network architectures up to now (internet, ATM, frame relay, and soon),
the network layer provides either a host to host connection service or host to host
connectionless service but not both.

By Deep Raj Bhujel Page 70


[Link]
iii. Connection oriented service in transport layer in implementedmat the edge of the
network in the end systems; however, the network layer connection service is
implemented in the network core as well as the end system.

Virtual Circuit (VC) Network


Many network architectures (not internet) including those of ATM and frame relay
are VC network and therefore, use connections at the network layer. These network
layer connections are called virtual circuits (VCs). Let‘s now consider how a VC
service can be implemented in a computer network.
A VC consists of
1) A path (i.e. a series of links and routers) between the source and destination hosts.
2) VC numbers, one number for each link along the path.
3) Entries in the forwarding table in each router along the path.
A packet belonging to a virtual circuit will carry a VC number in its header. Because a
virtual circuit may have a different VC number on each link, each intervening router
must replace the VC number of each traversing packet with a new VC number. The
new VC number is obtained from the forwarding table.
There are three identifiable phases in a virtual circuit
i) VC setup
ii) Data transfer
iii) VC teardown

Datagram network
Internet is a datagram network in which each time an end system wants to send a
packet, it stamps that packet with the address of the destination end system and
then pops packet into the network. Routers in a datagram network don‘t maintain
any state information about VCs.
As a packet is transmitted from source to destination, it passes through a series of
routers. Each of these routers uses the packets destination address to forward the
packet. Specifically, each routers has a forwarding table that maps destination
addresses to link interfaces, when a packet arrives at the router, the router uses the
packets destination address to look up the appropriate output link interface in the
forwarding table. The router then intentionally forwards the packet to that output
link interface.

Routing
Once you create an inter network by connecting your WANs and LANs to a router.
You‘ll need to configure local network addresses, such as IP addresses, to all hosts on

By Deep Raj Bhujel Page 71


[Link]
the internet work so that they can communicate across that internetwork.
m
The term routing refers to taking a packet from one device and sending it through
the network to another device on a different network. Routers don‘t really care
about hosts. They only care about networks and the best path to each network. The
logical network address of the destination host is used to get packets to a network
through a routed network, and then hardware address of the host is used to deliver
the packet from a router to the correct destination host.

Principles

By Deep Raj Bhujel Page 72


[Link]
If your network has ho routers, then it is clear that you are not m routing. Routers
route traffic to the entire network in your internetwork. To be able to route packets,
a router must know, at minimum, the following:
 Destination address
 Neighbor routers from which it can learn about remote network.
 Possible routers to all remote networks.
 The best route to each remote network.
 How to maintain and verify routing information.
The router learns about remote network from neighboring routers or from an
administrator. The router then builds a routing table (a map of the internet work)
that describes how to find the remote network. If the network is directly connected,
then the router already knows how to get to it.

Static Vs Dynamic Routing


If a network is not directly connected to the router the router must use one of two
ways to learn how to get to the remote network: static routing or dynamic routing.
Static routing means someone must hand-type all network locations into the routing
table. If static routing is used, the administrator is responsible for updating all
changes by hand onto all routers.
In dynamic routing, a protocol acts on all neighboring routers. Then the routers
update each other about all the networks they know about and place this
information into the routing table. If a change occurs in the network, the dynamic
routing protocols automatically inform all routers about the event e.g. RIP V1, RIP v2,
OSPF, EIGRP.

Routing algorithm: Distance vector vs. link


state There are three classes of routing
protocols:
i) Distance vector
The distance-vector protocols are in use today. Find the best path to a
remote network by judging distance. For e.g., in the case of RIP routing,
each time a packet goes through a router, that‘s called a hop. The route
with the least number of hops to the network is determined to be the
best route. The vector indicates the direction to the remote network.
E.g. : RIP, IGRP, they periodically send the entire routing table to directly
connected neighbors.
ii) Link State
By Deep Raj Bhujel Page 73
[Link]
It is also called shortest-path-first protocols in which
m the routers each
create three separate tables. One to keep track of directly attached
neighbors, one determines the topology of the entire internet work, and
one is used as the routing table. Link-state routers know more about the
internet work than any distance-vector routing protocol.
E.g. OSPF (Open Shortest Path First). They send updates containing the
state of their own links to all other directly connected routers on the
network, which is then propagated to their neighbors.
iii) Hybrid
Hybrid protocols use aspects of both distance vector and link state. E.g. : EIGRP.

Hierarchical Routing: intra-AS routing and inter-AS routing

By Deep Raj Bhujel Page 74


[Link]
m administrative
Autonomous system (AS) is a collection of networks under a common
domain, which basically means that all routers sharing the same routing table
information are in the same AS
According to AS, there are two types of routing protocols:
i. Intra-AS routing/interior Gateway protocol (IGP) e.g.: RIP, OSPF.
ii. Inter-AS routing/exterior Gateway protocol (EGP) e.g.: Border gateway protocol (BGP)

The internet Protocol (IP)


IP is sometimes referred to as an unreliable protocol. This does not mean that IP will
not accurately deliver data across a network. IP is unreliable because it does not
perform error checking and correction. That function is handled by upper layer
protocols from the transport or application layers.
IP performs the following operations:
 Defines a packet and an addressing scheme
 Transfers data between the internet layer and network access layer.
 Routers packets to remote hosts.
 The main function of IP is forwarding and addressing in the internet.

IPv4 Addressing
A router‘s job is to receive a datagram on one link and forward the datagram on
some other link, a router necessarily has two or more links to which it is connected.
The boundary between the router and any one of its link is called an interface.
Because every host and router is capable of sending and receiving IP datagram, IP
requires each host and router interface to have its own. IP address thus, an IP
address is technically associated with an interface, rather than with the host router
containing that interface.
Each IP address is 32 bits long (4 bytes) and thus a total of 2^32 possible IP address.
Approximately, there are about 4 billion possible IP addresses. These IP addresses
are typically written in so called dotted-decimal notation, in which each byte of the
address is written in its decimal from and is separated by a period (dot) from other
bytes in the address.
For e.g. : consider the IP address [Link] the 192 is the decimal equivalent of
the first 8 bits of the address, so are the 168, 10 and 5. Thus, the address
[Link] in binary notation is
11000000 101010000 00001010 00000101
Each interface an every host and router in the global internet must have an IP
address that is globally unique (except for interfaces behind NATs). A portion of an

By Deep Raj Bhujel Page 75


[Link]
interface‘s IP address will be determined by the subnet to which itm
is connected.

Different classes of IPV4 address


An internet address is made of 4 bytes (32 bits) that define a host‘s connection to
a network. IP address is made up of (netid + hostid)

By Deep Raj Bhujel Page 76


[Link]
m

Class A
• Range: 0 – 127
• So total of 126 (28-1) Networks are possible and total host = 224 in each Network.
• Default subnet mask is [Link]

Class B
• Range: 128 – 191
• So total of 216-2 Networks are possible and total host = 216 in each Network.
• Default subnet mask is [Link]
Class C
• Range: 192 – 223
• So total of 224-3 Networks are possible and total host = 28 in each Network.
• Default subnet mask is [Link]
Class D
• Range: 224 – 239
• Used for Multicasting
By Deep Raj Bhujel Page 77
[Link]
• E.g. [Link] (group) m
Class E
• Range 240-255
• Not used (for future use)

Private Vs Public Address


The people who created the IP addressing scheme also created the IP addressing
scheme also created what we call private IP addresses which can be used on a
private network, but they are not routable through the Internet. This is designed for
the purpose of creating a measure of well- needed security, but it also conveniently
saves valuable IP address space.
To accomplish the connection between the ISP and the corporation, the end user, no
matter who they are need to use something called Network Address Translation
(NAT), which basically takes a private IP address and converts it use on the internet.
Many people can use the some real IP address to transmit out onto the internet.
Doing things this way saves megatons of address space-good for us all.
The reserved private addresses
Class A: [Link] through [Link]
Class B: [Link] through [Link]
Class C: [Link] through [Link]

IP Datagram Format
Different s field used in IP (Version 4) datagram are depicted in fig below:

Version (4) HLEN Types of services Datagram Length (16)


(4) (8)
Identifier (16) Flags (3) Fragment Offset (13)
TTL (8) Protocol (8) Header Checksum (16)
Source IP address (32)
Destination IP address (32)
Options or Padding not always
Data (variable)

* Number in bracket indicates bits used in that field.

Version: Identifies the version of IP in use. Current version is IPV4.


HLEN: Header length is set to a value to indicate the length of datagram header.
Most IP datagram doesn‘t contain options, so HLEN mostly indicates where the data
begins in datagram. Typical IP datagram has 20 bytes header.
By Deep Raj Bhujel Page 78
[Link]
Types of services: Identifies different types of services included inmIP datagram such
as delay, throughput, precedence etc. IP datagram can be real-time or non-real-time
as per type of services Datagram Length: Indicates total length (Data + Header) of
the IP datagram. Maximum length if IP datagram is 216=65535 bytes but in general
not more than 1500 bytes.
Identifiers / Flags / Fragment Offset: Identifier (also called Fragment ID) indicates all fragments
that belong together. Flags indicate that other fragments to follow.

By Deep Raj Bhujel Page 79


[Link]
m

By Deep Raj Bhujel Page 80

You might also like