networking
How do TCP/IP and HTTP work together?
The network layers use abstraction and encapsulation. The lower layers encapsulate the higher layers. The Application layer can have its own protocols, e.g. HTTP. HTTP communicates with HTTP on the target device, and it is a protocol that transfers the application data (HTML). The Transport layer (layer 4) encapsulates the application datagrams, and it communicates … Read more
What is a message boundary?
No, message boundaries have nothing to do with destinations or ports. A “message boundary” is the separation between two messages being sent over a protocol. UDP preserves message boundaries. If you send “FOO” and then “BAR” over UDP, the other end will receive two datagrams, one containing “FOO” and the other containing “BAR”. If you … Read more
How to disable/enable network connection in c#
Found this thread while searching for the same thing, so, here is the answer 🙂 The best method I tested in C# uses WMI. http://www.codeproject.com/KB/cs/EverythingInWmi02.aspx Win32_NetworkAdapter on msdn C# Snippet : (System.Management must be referenced in the solution, and in using declarations) SelectQuery wmiQuery = new SelectQuery(“SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId != NULL”); ManagementObjectSearcher … Read more
Command/Powershell script to reset a network adapter
You can use WMI from within PowerShell to accomplish this. Assuming there is a network adapter who’s device name has Wireless in it, the series of commands might look something like the following: $adaptor = Get-WmiObject -Class Win32_NetworkAdapter | Where-Object {$_.Name -like “*Wireless*”} $adaptor.Disable() $adaptor.Enable() Remember, if you’re running this with Window’s Vista, you may … Read more
Linux API to determine sockets owned by a process
I think you first have to look through the open fds in /proc/*/fd, e.g. 4 -> socket:[11147] and then look for the referenced sockets (by the inode) in /proc/net/tcp (or /proc/net/udp), e.g. 12: B382595D:8B40 D5C43B45:0050 01 00000000:00000000 00:00000000 00000000 1000 0 11065 1 ffff88008bd35480 69 4 12 4 -1
Any difference between socket connection and tcp connection?
TCP/IP is a protocol stack for communication, a socket is an endpoint in a (bidirectional) communication. A socket need not be TCP based, but it is quite often the case. The term socket is also often used to refer to the API provided by the operating system that allows you to make a connection over … Read more
How can I capture network packets per PID? [closed]
Not directly a tcpdump, but can give you info about the network traffic, check https://bytefreaks.net/gnulinux/how-to-capture-all-network-traffic-of-a-single-process strace -f -e trace=network -s 10000 <PROCESS WITH ARGUMENTS>; If the process is already started and you know its PID you can use the following 1 strace -f -e trace=network -s 10000 -p <PID>; Another alternative is more complex, using … Read more
Docker Container Networking with Docker-in-Docker
There are pros and cons for both DinD and bind mounting the Docker socket and there are certainly use cases for both. As an example, check out this set of blog posts, which does a good job of explaining one of the use cases. Given your example docker-in-docker setup above, you can access Apache httpd … Read more
What is the difference between IPoIB and TCP over InfiniBand?
InfiniBand adapters (“HCAs”) provide a couple of advanced features that can be used via the native “verbs” programming interface: Data transfers can be initiated directly from userspace to the hardware, bypassing the kernel and avoiding the overhead of a system call. The adapter can handle all of the network protocol of breaking a large message … Read more