Starting from:

$25

CS4150 - Lab 10 - Solved

1. You are given the virtual network in Fig. 1. This network has two subnets, and one node common to both these subnets. Your first exercise is to write a simple packet sniffer at node

 

Figure 1: A network with 2 subnets.



 
 
 

r1. This packet sniffer should print the MAC addresses (source and destination), IP addresses (source and destination) of all IP packets sent and received by r1. Refer https://www. binarytides.com/raw-sockets-c-code-linux/ and http://squidarth.com/networking/

systems/rc/2018/05/28/using-raw-sockets.html

2. Modify the packet sniffer in the previous exercise to print the MAC addresses (source and destination), IP addresses (source and destination) of only those IP packets that are received
[50]
by r1 on interface eth1.

3. Enhance the program created in the previous exercise so that you transfer IP packets across the subnets in Fig. 1. Infact, you will essentially be building a rudimentary router. Some hints
[20]
can be found at https://opensourceforu.com/2015/03/a-guide-to-using-raw-sockets/
[30]
End of paper

More products