CN - 1 Sample Lab Programs
CN - 1 Sample Lab Programs
Now, before any host can use a DNS service, we must configure a DNS server first. For
example, when you type the URL http://www.google.com in your browser, the host will query
the DNS server for the IP address of http://www.google.com. The DNS server will
resolve http://www.google.com into an IP address then answer back the host with the IP
address.
An HTTP server is a web server. It stores web resources that can be accessed by a web
client. Your PC’s browser(a web client) requests for web resources from a web server over
the internet.Web resources are files such as text and images that the server will give to the
client on request.
Configuration of PC
1.Use Simulation Mode Select the PC with IP Address 192.168.1.3 . Click on the webBrowser and
type 192.168.2.2 . Show the Demo of TCP by right clicking on the Envelop. Note down the values at
every Layer.
1. At the same PC in Simulation mode select web Browser and type bmsce.in
2. Show the demo of UDP with DNS
Design a network that provides a pool of private IP addresses at each LANs. The LAN s in
turn connected to a WAN Gate way Router with a pubic IP address provided by ISP.
For a computer to communicate with the Internet as a whole, it must have an IP address. Using
the IPv4 system, these are unique, 32-bit numbers that are broken up into four different binary
octets. It doesn’t matter whether it’s a server, or a computer, or an Xbox. If it doesn’t have an
IP address, it’s not getting online.
But, there simply isn’t enough IP addresses to go around to give each host their own address.
So, in order to make better use of the extremely limited address space available, we use
Network Address Translation.
Network Address Translation allows a single device to sit between a local area network and
the Internet, and forward traffic to the appropriate host. You probably know this as your router.
The advantage of this is multiple computers can share the same IP public address.
This single device (usually a router, switch, or hardware firewall) modifies IP packet headers
on the fly, ensuring that the contents of the packet get to the intended destination. However, it
comes with a downside, as it becomes exponentially harder for hosts outside the local network
to communicate with servers that are located behind the router.
There are multiple ways in which Network Address Translation can work, with the three of the
most common being Dynamic NAT, Static NAT, and Overloading.
1) Dynamic NAT
With Dynamic NAT, a router will maintain a list of public IP addresses. When a host behind
the network needs to transmit or receive, the router will select one of the public IP addresses
that is not currently in use, and forward any packets accordingly. As a result, this means a
host’s IP address can change at any given moment.
But crucially, it means a large pool of hosts can share a significantly smaller pool of IP
addresses. This was vital, given the impending exhaustion of the available pool of IPv4
addresses.
2) Overloading (PAT)
A common way of performing network address translation is through something called
‘Overloading’, where multiple internal IP addresses are mapped to a single public IP address.
This is done by giving each internal host a corresponding port. For instance, suppose you’ve
got three computers on an internal network, and a public IP address of 212.18.123.123. Each
of those internal computers could theoretically be accessible via 212.18.123.123:2001,
212.18.123.123:2002 and 212.18.123.123:2003.
This is commonly known as Port Address Translation (PAT), Single-Address NAT, and port-
level multiplexed NAT.
3) Static NAT
Finally, let’s talk about Static NAT.
Internal networks, like your home or office network, do not use the same IP addressing system
that’s used on the public Internet. Any networked device effectively has two IP addresses. The
first is a private one, and that’s only reachable from within that network. The second is the one
that’s externally accessible.
Static NAT makes it possible to create a direct, one-to-one link between a private IP address
and a static, public IP address.
Router>enable
Router#configure terminal
Router(config)#interface fastethernet 0/0
Router(config)#ip nat inside
Router(config)#interface fastethernet 0/1
Router(config)#ip nat outside
Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
Router(config)#ip nat pool public-ips 117.45.23.2 117.45.23.5 netmask 255.255.255.0
Router(config)#ip nat inside source list 1 pool public-ips overload
Step 3: Ping from PC2 to Router 1 and check the NAT table
To see NAT table select inspect tool at right side and click on router 0 then select NAT table.
Step 1: Design the network as shown in the figure.
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router#enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa1/0
Router(config-if)#ip add 117.45.23.2 255.255.255.0
Router(config-if)#no shut
Step 5: configure NATing at Gate way Router
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip add 117.45.23.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
Step 8: Ping PC to ISP Router and check the nat table
Router#enable
Router#show ip nat translations
Department of Information Science and Engineering
LAB PROGRAMS FOR COMPUTER NETWORKS-1
DHCP Server:- The DHCP (Dynamic Host Configuration Protocol) is a network protocol
used to assign IP automatically to the systems with the help of a machine called DHCP server.
A DHCP Server allows computers to request an IP address and networking parameters
automatically. If you do not have a DHCP Server to configure IP addresses automatically to
the PCs then you need to assign a static or manual IP address on the Computers. So in simple
words, we can say that DHCP Server is only used for assigning the IP addresses to the Systems
automatically.
Configuration of DHCP Server