Beruflich Dokumente
Kultur Dokumente
Martin Pieuchot
mpi@openbsd.org
EuroBSDcon, Sofia
September 2014
sys/net/radix mpath.c
/*
* Stolen from radix.c rn addroute().
* This is nasty code with a certain amount of magic and dragons.
[...]
*/
2 of 25
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
3 of 25
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
4 of 25
Motivation
5 of 25
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
6 of 25
Identify peers
Direct packets
7 of 25
IPv4 header
Journey of a packet
Identify
Input
For me?
yes
Deliver
no
Forward?
Direct
yes
Send
8 of 25
Select interface
Output
Representation of an address
9 of 25
/*
/*
/*
/*
/*
/*
address of interface */
other end of p-to-p link */
broadcast address interface */
used to determine subnet */
back-pointer to interface */
list of addresses for interface */
ifp
RB-tree
if_sadl ifa_ifp
lladdr
10 of 25
Int. List
rtentry
ifp
RB-tree
if_sadl ifa_ifp
ifa_ifp
lladdr
ifa
11 of 25
Addr. List
For me?
yes
Deliver
RB-tree
Addr. List
Int. List
no
ip forward
Forward?
ip output
yes
Send
12 of 25
Select interface
Routing table*
Output
Routing table*
Addr. List
Int. List
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
13 of 25
Global lists
14 of 25
Interface list
15 of 25
Routing table
16 of 25
Addr. List
Addr. List
ifp
ifa0
all hosts
ifa1
mcast
ifa2
mcast
ifa0
ifa1
ifa2
mcast
mcast
all hosts
OpenBSD 5.4
17 of 25
OpenBSD 5.5
Related changes
The link-layer address has been remove from all the lists
18 of 25
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
19 of 25
rtentry
Int. List
ifa
ifa_ifp
ifp
20 of 25
For me?
yes
Deliver
Routing table*
no
ip forward
Forward?
ip output
yes
Send
21 of 25
Select interface
Output
Routing table*
22 of 25
Agenda
Motivation
Representing Addresses & Routes
Stack Metamorphosis
Where are we now?
Conclusion
23 of 25
Conclusion
24 of 25
Questions?
Slides on http://www.openbsd.org/papers/
25 of 25