Question: N 1 . 1 . What is the network prefix for each of the following hosts: ( 1 ) 1 0 . 1 . 2

N1.1. What is the network prefix for each of the following hosts: (1)10.1.2.200/24 and
(2)10.1.2.20026?
N1.3. We write the following program to send a packet. (1) How is the source port number of
the packet decided? (2) How is the source IP of the packet decided?
data = b"Hello, Server ??
udp = socket.socket (socket.AF_INET, socket.sOCK_DGRAM)
udp.sendto (data,("10.9.0.5",-9090))
N1.4. When we construct a packet, we need to set the address at each layer. What are the
addresses called at he following layers: (1) transport layer, (2) network layer, and (3)
data link layer?
N1.5. When we run "nc -lnu 9090", what does the options "lnu" mean?
N1.6. What does the bind do in the following code snippet? What is the meaning of
0.0.0.0?
If we are only interested in the packets coming from the localhost, what should be do?
udp = socket.socket(socket.AFINET, socket.SOCKDGRAM)
udp.bind((0.0.0.0,9090))
N1.7. In a server program, we bind the program to a port number, so when a packet comes to
that port, the OS knows which program is the recipient of the packet. However, for the
client program, we typically do not do the binding. When a reply from the server
comes, how does the OS know that this client program is the recipient?
N1.8. Why does the sniffing use the superuser privilege?
N1.9.(1) Write down the tcpdump command to print out all the packets to UDP destination
port 53 on the interface xyz.(2) Write down the tcpdump command to print out all
the packets from port 1000 to port 53 on the interface xyz.
N1.10. Please explain the purpose of each of the arguments in the following Scapy code snippet.
pkt= sniff(iface=' etho', filter='icmp', prn=printpkt)
N1.11. The following result of the "ip address" command shows all the network inter-
faces on a host. Please write a Scapy program to sniff the packets transmitted over the
192.168.5.0/24 network. You are only interested in the UDP packets to 8.8.8.8's
port 53.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!