Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help needed : implementation of virtual router

Status
Not open for further replies.

cookieman

Newbie level 1
Joined
Sep 4, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
socat for smoothwall

the idea is to implement a user level software(C in linux) that performs routing functions on the packets captured from the ethernet card. In Linux, the PCAP.H library can be imported to capture packets from the n/w card. Whenever a packet arrives in the n/w card... it is captured and sniffed. After identifying the IP address, the IP table is searched for the network and if that network address is there, then the packet is injected back into the ethernet card usig another libray "LIBNET". For dyanmic routing, the "OSPF" algorithm needs to be implemented.
does this seem possible to achieve?? can anyone help me on how to get started on writing the source code??
 

yes it does seem possible. Looks like you want to do stream redirection of ethernet packets. Remeber, in Linux all devices are "filesystems".

A hard "hack" could be to use something like tcpdump to caputre the packets and get source and destination packets, then use another program called Socat (it is a stream redirector) to redirect the packet to another stream, system or other. You can code it yourself. Shoulf not be a problem. Read up on sockets, signal handling, pcap and a few more. I would be to lazy and just write a script that would use the above mentioned programs.
What is nice a bout Socat, it can implement SSL security over your networks as well. So less possibility of hacking.
-EDIT-
Now that I think about it. Most linux distrobutions can be setup to do routing over
connected network devices. You can go to www.sourceforge.net or www.freshmeat.net and just type router in the search area. You will probably get hundreds of hits.
So this will automatically show that what you want to do is possible and already done. But if it is a project and you have to code from scratch. look at open source code from above mentioned websites and read some man pages.

Added after 12 minutes:

ok fine, I know I'm replying to my own answer, but after you read all what I typed above, take a look at:

Code:
http://sourceforge.net/projects/smoothwall
Code:
http://freshmeat.net/projects/click/
Code:
http://www.gated.org/
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top