Preview

Socket Programming Commands

Satisfactory Essays
Open Document
Open Document
732 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Socket Programming Commands
Aim: To Study Socket Programming Commands

Theory: ss - socket statistics
The netstat command has been replaced by the ss command from the iproute suite of tools.
The netstat command reads various /proc files to gather information. However this approach falls weak when there are lots of connections to display. This makes it slower.
The ss command gets its information directly from kernel space.
Following examples shows the use of ss command.
1. List all connections

The output contains all tcp, udp and unix socket connection details.
We are piping the output to less so that the output is scrollable.

2. Filter out tcp,udp or unix connections
To view only tcp or udp or unix connections use the t, u or x option.

The "t" option alone reports only those connections that are "established" or CONNECTED". It does not report the tcp sockets that are "LISTENING".
The “a” option tells ss to report both "CONNECTED" and "LISTENING" sockets.

UDP is a connection-less protocol, just "ss -u" will not report anything in most cases. Therefore we use the "a" option report all UDP connections (connected and listening).
The “x” option to list out all unix socket connections.

3. Do not resolve hostname
To get the output faster, use the "n" option to prevent ss from resolving ip addresses to hostnames. But this will prevent resolution of port numbers as well.

4. Show only listening sockets
This will list out all the listening sockets. For example apache web server opens a socket connection on port 80 to listen for incoming connections.

The above command lists out all "listening" "tcp" connections. The n option disables hostname resolution of the ip addresses giving the output faster.
To list out all listening udp connections replace t by u

5. Print process name and pid
To print out the process name/pid which owns the connection use the p option

6. Print summary statistics
The s option prints out the statistics.

7. Display timer

You May Also Find These Documents Helpful

  • Powerful Essays

    Tcptrack is a sniffer which displays information about TCP connections it sees on a network interface.…

    • 1518 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    NT2640 Lab 7 SC

    • 2232 Words
    • 17 Pages

    I thought it would have been the same ip address but it is showing the loopback loop. R1 will apparently choose the highest Ip address on a loopback interface…

    • 2232 Words
    • 17 Pages
    Satisfactory Essays
  • Powerful Essays

    In the Screenshot above, cdn2 has a different IP (54.230.2.234) in one case and cdn0 also has a different IP (54.230.3.190) for three different objects. o Now, because we parse har file w.r.t host name and pcap w.r.t IP, all three of cdn0, cdn2, cdn3 have same TCP connections in the table as they have same IPs. o Better way to read this would be to consider only non-zero download size connections for each of these three domains. Haven’t implemented it to avoid irregularity in the table.…

    • 2486 Words
    • 10 Pages
    Powerful Essays
  • Powerful Essays

    IS3220 FINAL STUDY GUIDE

    • 1708 Words
    • 7 Pages

    To establish a connection, TCP uses a three-way handshake. Before a client attempts to connect with a server, the server must first bind to and listen at a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:…

    • 1708 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    The NETSTAT utility is a command available on most platforms that enables a user to list the sockets in use on a system. The information returned by the command is only for the local host, and there is no provision for monitoring remote hosts using this utility.…

    • 670 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    8) How many total IP hosts dod you find on the server farm VLAN using the Nessus Lab #4 server farm scan?…

    • 486 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    (167) Command issued to upgrade an old version of the Cisco IOS software by downloading a new image from the TFTP server…

    • 469 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Nt1310 Unit 7

    • 458 Words
    • 2 Pages

    The first 8 bits of the host address and set the rest of the numbers in the address to 0.…

    • 458 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1330 Unit 5 Assignment 1

    • 1348 Words
    • 6 Pages

    4. The server accept the connection and to send the data from server to client and vice…

    • 1348 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Copy and paste the following screenshots from your Using Show Commands to Investigate Network Status lab.…

    • 1117 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    netw 240 week 7

    • 330 Words
    • 3 Pages

    What Field in the TCP header contains a well known port number that maps to the Application that will handle the segment Data Stream?…

    • 330 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    After reviewing the port scan results for the indicated hosts, one can readily see that some of these services must be disabled. Authentication services are necessary, I recommend configuring the system to pass or allow this service. The three services I know to be unnecessary, based on our network topology are the Secure Shell (SSH), Microsoft Remote Procedure Call (MSRPC), File Transfer Protocol (FTP). Simple Mail Transfer Protocol (SMTP) is essential to email communications in a Windows network, this service allows users within the network to send and receive emails. We do not allow remote users at this time, due to this MSRPC should be disabled, this protocol was heavily used in Windows 2000 environments, but is now highly vulnerable, and most networks have it disabled.…

    • 438 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Nmap ("Network Mapper") is a free and open source utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets to determine what hosts are available on the network, what services those hosts are offering, what operating systems they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, and also works against single hosts. Nmap runs on all major computer operating systems, Linux, Windows, and Mac OS…

    • 414 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Use the DETER Visualization tab to show the network and use arp and ifconfig commands to detect MAC and IP addresses for each machine.…

    • 2570 Words
    • 11 Pages
    Good Essays

Related Topics