Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Friday, May 27, 2011

Browse » Home » , , , , , , , , , , » Network programming in C under Linux

Network programming in C under Linux

In this tutorial we will deal with networkprogramming under LINUX (/UNIX). During this we will only work with the Programminglanguage C. Precognition of C are needed. You should know what a describtor or a string is. #

Furthermore the reader has to be intrested, so when you don
't know one of the listed functions (e.g. "read", "write") you should check out the according manual ( $ man function).
Misspellings are due to the state of mind of the author. The text is written in a simple form and only contains the main important details of the functions.

A little bit of knowlegde about TCP/IP should be enough to understand the topic, wheras we will only deal with IPv4 here. We will emphasise on TCP.

So this Tut is an introduction and topics like threading or multicasting will not be discussed.


1.0 Preface

2.0 Introduction

3.0 Basic Functions (Client Side)

3.1 socket

3.2 connect

3.3 close

3.4 sockaddr_in Structur

3.5 Example Program (Portscanner)

4.0 Basic Functions (Server Side)

4.1 bind

4.2 listen

4.3 accept

4.4 Example Program (Fakeserver)

5.0 UDP

5.1 UDP Clients

5.1.1 sendto

5.1.2 recvfrom

5.1.3 connect with UDP?

5.2 UDP Server

5.3 UDP Client/Server Example (sysinfs.c sysinfs.c)

6.0 Sophisticated Server

6.1 fork

6.2 signal

6.3 Example Progam (Parallel-Server / Trojan Echoserver).

7.0 Introduction to Raw-Sockets

7.1 Header Overview

7.1.1 IP Header

7.1.2 TCP Header

7.1.3 UDPHeader

7.1.4 ICMPHeader

7.1.5 Pseudo Header

7.2 Example Program (TCP-Sniffer)

7.3 sendto

7.4 Example Program (Pong / Variety of Ping)

7.5 select

7.6 Improvement (Pong)

7.7 Functions for easy/fast Raw-Socket programming

8.0 Summary

9.0 Greets

2.0 Introduction

C is a very flexible language that ranges across a wide area of programming. So terms like  Kernel programming, Systemp rogramming and Network programming are well known. The network programming deals with the communication between a client and a server . The server allocates a service, while the client connects to the server to call on this service. Normaly networkable programms are send/shiped out with the operating system. So one knows Web-Browser, FTP-Clients or POP-Clients. But we want to write our own server/client applications.

Sockets are a total transparent interface to a remote host. In doing so it does not matter if the host is in our LAN or is sited/remaining in a WAN. Through the socket datapackets are send from us as far as to a remote host. We just tell the socket what we want and it does the rest of the work. A total different things are Raw-Sockets. As the name implies, here the transparancy of the network communications are repealed. We as the programmers are now able to send our selfmade datapakets, thanks to the Raw-Sockets.

Download full tutorial...
Password : "qq" (without quote)

You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.


Post a Comment

Back to Top