Connections aus /proc/$PID/fd
herausfinden
Wie finde ich aus der Info aus /proc/$PID/fd/ die Connections die ein Programm hat:
lsof und Internet Sockets
- lsof -i zeigt alle “Internet network files”, kombiniert mit -a (logisches AND) und -p für die Pid bekomme ich alle Internet Connections zu dieser pid:
|
|
Leider lassen sich die übersetzung der Nummern in Namen nicht ausschalten.
Hier mit -i und -p:
|
|
Leider zeigt lsof nur die Inet Sockets an, meistens haben wir aber noch ein paar mehr sockets
SS und Unix domain sockets
Was sind welche Spalten
-
Netid: Eine Kombination aus Typ + Art: ++ U_str: unix_stream ++ u_dgr: unix_datagram ++ tcp: ;-)
-
Local Address: Port bei Unix Stream und Unix Datagram
ss -x
Verschiedenen Familien:
- ss -x -a # Alle Unix
- ss -t -a # Alle Tcp ss -u -a # Alle UDP
Welche Sockets gibts überhaupt
- inet4 und inet6
- TCP klar und einfach
- UDP
- dccp Datagram Congestion Control Protrocol ++ gleiche Ebene wie UDP+TCP ++ keine Zuverlässigkeitsprüfunung wie in tcp ++ aber eine Session (nicht wie udp)
- raw: neue Protokolle für inet4|6 in user space
- sctp: auf Ip bassierend. Verbindungsorientiert, Multihome
- unix: ipc sockets in dgram oder stream qualität;), nur für locale IPC, haben eine Inode
Links:
- lsof auf Stackexchange(How Do i find out more about socket files in proc fd)[https://unix.stackexchange.com/questions/235979/how-do-i-find-out-more-about-socket-files-in-proc-fd]
- Unix Sockets (Linux Unix Programmierung)[http://openbook.rheinwerk-verlag.de/linux_unix_programmierung/Kap11-017.htm]