Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

TCP/UDP Ports Ports are important because they tell incoming packets what progra

ID: 3723275 • Letter: T

Question

TCP/UDP Ports Ports are important because they tell incoming packets what program(s) the data should be sent to. There are two types of Ports, TCP and UDP. Each Port has a number associated with it, and there are thousands of them. Each Port number is associated with a specific program - just like when you created a Socket in your programing assignments and assigned it to a Port number. So for this assignment, your task is to find a Port number that is used for a specific program or task and the program or task associated with that port number. You'll need to list the Port number; whether it is a TCP Port, a UDP Port, or both; and you'll need to describe the task or program that this Port number is reserved to. Please make your post in complete sentences; 3-5 should be enough for all the information.

Explanation / Answer

command:

sudo netstat -pantu | awk '{print $1," ",$4, " ", $NF," "}'

meaning of different flags/options used in the netstat command

p - diplay process info

a - display all sockets

t - tcp ports

u - udp ports

n - donot resolve hosts

output example:

$ sudo netstat -pantu | awk '{print $1," ",$4, " ", $NF," "}'
Active (servers established)
Proto Local name
tcp 0.0.0.0:8139 141386/ruby
tcp 0.0.0.0:5901 9936/Xvnc
tcp 0.0.0.0:38798 1606/rpc.statd
tcp 0.0.0.0:111 1649/rpcbind
tcp 0.0.0.0:20048 1736/rpc.mountd
tcp 0.0.0.0:6001 9936/Xvnc
tcp 192.168.122.1:53 3104/dnsmasq
tcp 127.0.0.1:53 1609/dnsmasq
tcp 0.0.0.0:22 1600/sshd
tcp 127.0.0.1:631 1605/cupsd
tcp 127.0.0.1:8089 8550/splunkd

1 column -> protocol

2 column -> ip and port

3. column -> ID and name of process which is using this port right now.