Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

N 5 . 2 . If an application needs to ensure the order of the packets, but UDP does not provide such a guarantee, does

N5.2. If an application needs to ensure the order of the packets, but UDP does not provide such a guarantee, does the
application have to use TCP? Can it still use UDP?
N5.3. Why is UDP in general more suitable for real-time applications than TCP?
N5.4. In the following code snippet, what does the IP address 0.0.0.0 means?
udp = socket.socket(socket.AFINET, socket.SOCKDGRAM)
udp.bind((0.0.0.0,9090))
N5.5. When spoofing a UDP packet using Scapy, why do we typically set the UDP checksum field to zero?
N5.7. An open-source program has the following behavior: after receiving a message on its
UDP port, it immediate sends a response to the client. Alice runs such a program on her
machine (10.8.0.8), using port 8000. Bob also runs the program on his machine
(192.168.0.7), using port 7000.(1) Please write a simple Python program to trigger a UDP
ping pong between these two machines. (2) Please describe how you can help this open-source
program fix this problem (just describing your solution would be sufficient).
N5.8. What type of services are good candidates for the UDP amplification attack?
N6.1. This problem is based on following TCP client program. (1) To get responses from the server, the TCP client
program should register for a source port number, but in the program, this step seems to be missing. Without this port
number, how can the client program get responses? (2) Which line of the code triggers the three-way handshake
protocol? (3) There are two sendall () calls in this client program, will each call trigger a separate TCP packet?
#!/bin/env python3
import socket
tcp = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
tcp.connect (('10.0.2.69',9090))
tcp.sendall (b"Hello Server!
")
tcp.sendall (b"Hello Again!
")
tcp.close ()
N6.2. This problem is based on the following TCP server program. (1) Does the program
get blocked when invoking listen() until a connection comes? (2) What is the
purpose of the accept ()?(3) Why does the accept () call create a new socket?
Why cannot we use the same one that is used in the listen() call?
#!/bin/env python3
import socket
tcp = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
tcp.bind (("0.0.0.0",9090))
tcp.listen()
print (data)
conn. sendall (b"Got the data!
")
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions