CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Implement 2 Ip addresses in TCP/IP stack

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Manel28



Joined: 06 May 2010
Posts: 33

View user's profile Send private message

Implement 2 Ip addresses in TCP/IP stack
PostPosted: Tue Mar 26, 2013 3:41 am     Reply with quote

Hi there,

does anybody know how to modify the TCP/IP stack in order to have 2 differenet IP addresses. I want my PIC+ ENC28J60 to listen to all incoming packets to 2 different IP interfaces.

Thanks for the help
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Mar 26, 2013 5:46 am     Reply with quote

As far as I see, multihoming requires several features that are not provided by the Microchip TCP stack. The Beta V6.0 has support for multiple network interfaces, you'll need to port it to CCS.
Ttelmah



Joined: 11 Mar 2010
Posts: 19389

View user's profile Send private message

PostPosted: Tue Mar 26, 2013 5:51 am     Reply with quote

I'm not sure it is easy with that Ethernet chip either. The automatic filters don't support two addresses (except things like the broadcast address), so you'd have to effectively 'manually check' the packets.
There are later Ethernet chips with support for this.

Best Wishes
Manel28



Joined: 06 May 2010
Posts: 33

View user's profile Send private message

PostPosted: Tue Mar 26, 2013 6:15 am     Reply with quote

Thanks for the info Smile
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Mar 26, 2013 10:23 am     Reply with quote

These issues are solvable. Only one physical interface is being used and the low level NIC driver is not concerned about IP addresses so it does not prevent packets from being processed by the upper layer IP stack (which you can modify).

This leaves the issue of MAC addresses. If the two IP addresses are in different subnets then they may be able to share the same MAC address. It will not impact the upstream switch or router. You could use multiple MAC addresses but to do this you will either need to configure the Ethernet controller to accept all destination MAC addresses (not very good) or you need to configure and enable the MAC hash table.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!


Last edited by asmallri on Wed Mar 27, 2013 4:11 am; edited 1 time in total
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Mar 27, 2013 12:40 am     Reply with quote

Ttelmah wrote:
I'm not sure it is easy with that Ethernet chip either. The automatic filters don't support two addresses (except things like the broadcast address), so you'd have to effectively 'manually check' the packets.
There are later Ethernet chips with support for this.

I presume that multiple IP addresses will be bound to the same mac address. This can work with any network chip.

P.S.: I see, Andrew already commented the point.
Ttelmah



Joined: 11 Mar 2010
Posts: 19389

View user's profile Send private message

PostPosted: Wed Mar 27, 2013 5:52 am     Reply with quote

I must admit when I've done multi-homing, I've wanted multiple Mac addresses.
Have always just used a lot more 'grunt' than the PIC. When you look at what you can get a matchbox PC, running Linux for, this sort of job is the an absolute doddle. Especially going with a USB SD based machine...

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group