UDP sockets UDP stands for User Datagram Protocol and is an alternative protocol to TCP the most common protocol used for data transfer over the internet. UDP is different from TCP in a number of ways. Most importantly UDP is a connectionless protocol. In the TCP protocol first a connection is established by performing the… Read More »
UDP sockets This article describes how to write a simple echo server and client using udp sockets in C on Linux/Unix platform. UDP sockets or Datagram sockets are different from the TCP sockets in a number of ways. The most important difference is that UDP sockets are not connection oriented. More technically speaking, a UDP… Read More »
In an earlier article we saw how to send and receive data in python using sockets. Lets take a quick example : The output of the above code might be something like this : The problem ? The output is not complete. Some data has been left out. Communication like the above takes places through… Read More »
In a previous example we learnt about the . In this example we shall build a basic ECHO client and server. The server/client shown here use TCP sockets or SOCK_STREAM. Tcp sockets are connection oriented, means that they have a concept of independant connection on a certain port which one application can use at a… Read More »
Socket programming in Java This is a quick guide/tutorial to learning socket programming in Java. The Socket class is documented at http://docs.oracle.com/javase/1.4.2/docs/api/java/net/Socket.html To summarise the basics, sockets are the fundamental “things” behind any kind of network communications done by your computer. For example when you type www.google.com in your web browser, it opens a socket… Read More »
Tutorial on how to code simple network servers and clients using low level Socket api in python.
Php and tcp/ip sockets This is a quick guide/tutorial to learning socket programming in php. Socket programming php is very similar to C. Most functions are similar in names, parameters and output. However unlike C, socket programs written in php would run the same way on any os that has php installed. So the code… Read More »
This is a small script written in php that can fetch the whois information of an ip address from regional internet registries (RIR). Useful in finding information about ip address.
The mac address or the hardware address or the ethernet address of an interface is a 48 bit number that looks like this : 00:1c:c0:f8:79:ee The mac address of an interface can be found given its name. The function to use is ioctl. Code Output $ gcc interface_mac.c && ./a.out Mac : 00:10:0c:28:89:1e Last Updated… Read More »
Interface name is something like “eth0” and the ip address of the interface can be retrieved using the ioctl function. Here is a simple piece of code that demonstrates how : Code Output The socket used can be a TCP socket (SOCK_STREAM) as well. If you also need the netmask then use the SIOCGIFNETMASK value… Read More »