Ethernet Bridge development
 help / color / mirror / Atom feed
From: Cameron Schaus <cam@schaus.ca>
To: Jie Chen <cj70286@hotmail.com>, bridge@lists.osdl.org
Subject: Re: [Bridge] Monitor the status of two ethernet interface
Date: Thu, 21 Dec 2006 13:17:16 -0500	[thread overview]
Message-ID: <458ACFAC.6070006@schaus.ca> (raw)
In-Reply-To: <BAY104-F19B0380CB9513341B059CFDCE0@phx.gbl>

Jie Chen wrote:
> Hi Stephen,
>
> I've been reading the source code for a few days. I can locate these 
> two files:
> /usr/include/linux/sockios.h
> /usr/include/sys/ioctl.h
> and I want to look at the codes for the function ioctl(), since there 
> are so many files includes ioctl() under /usr/ folder. Do you have any 
> idea which specific one we are using? For example, does the one in 
> following file look the correct one?
> /usr/src/linux-2.6.15_gz/net/socket.c
The bridge ioctls are in net/bridge/br_ioctl.c, but some of the bridge 
functionality is done using the sysfs interface, whose code in is 
br_sys_{br,if}.c.

> Thanks for the nice architecture drawing. What is the relationship 
> between TCP/IP architecture and the architecture you showed me? The 
> bridge driver should be considered as physical layer and IP layer is 
> above that?
You will want to check out the netif_receive_skb function in 
net/core/dev.c and note the bridge hooks used to pass packets to the 
bride code.  This is done prior to IP processing.

> For STP, if there's no Daemon running behind, who's maintaining the 
> STP table and who decide which interface to go with?
This is done by the kernel bridge code, using timers and incoming 
packets to trigger STP state changes.  The code of interest is in 
/usr/src/linux/net/bridge/br_stp.*, with some of the timer creation/init 
done when bridge entities are created.  Search for br_stp_timer_init and 
br_stp_port_timer_init.

All of the bridge code is in net/bridge/ and I would recommend the 
"Understanding Linux Network Internals" book published by O'Reilly 
publishing.  This book has several chapters that explain in detail the 
linux bridge and STP implementation, as well as a chapter that explains 
STP in detail.

Cam


  reply	other threads:[~2006-12-21 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 21:26 [Bridge] Monitor the status of two ethernet interface Jie Chen
2006-12-20 22:32 ` Stephen Hemminger
2006-12-21 13:50   ` Jie Chen
2006-12-21 15:51     ` Stephen Hemminger
2006-12-21 19:52       ` Jie Chen
2006-12-21 18:17         ` Cameron Schaus [this message]
2006-12-29 15:59           ` Jie Chen
2007-01-04 20:39           ` Jie Chen
2007-01-04 21:03             ` Stephen Hemminger
2007-01-04 21:20               ` Jie Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458ACFAC.6070006@schaus.ca \
    --to=cam@schaus.ca \
    --cc=bridge@lists.osdl.org \
    --cc=cj70286@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox