summaryrefslogtreecommitdiff
path: root/doc/packet-flows
blob: 8afe695383243648b9edec8c2ada68ca06cfc19d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
This document describes the packet flows in DHCPv4, DHCPv6 and
DHCPv4-over-DHCPv6 for the client and the server.

DHCPv4 client
-------------

State machine (including startup and timeouts)
 |
send_<message_type>()
 |            |
send_packet() |
              |
             add_timeout() (for retry)

I/O receive handler got_one()
 |
receive_packet()
 |
do_packet() (bootp_packet_handler)
 |              |           |
parse_options() |           |
               bootp()      |
                |          dhcp()
               dhcpoffer()  |
                           dhcp{offer,nack,ack}()
                            |
                           manage lease & state machine

DHCPv6 client
-------------

State machine (including startup and timeouts)
 |
do_xxx()
 |
append IA_NA, IA_TA and/or IA_PD
 |             |
send_packet6() |
               |
              add_timeout() (for retry)

I/O receive handler got_one_v6()
 |
receive_packet6()
 |
do_packet6() (dhcpv6_packet_handler) (relayed or direct message)
 |
parse_option_buffer()
 |
dhcpv6()
 |
xxx_handler() (v6_handler)
 |            |
valid_reply() |
              |
             manage lease (dhc6_leaseify(), ...) & state machine

DHCPv4-over-DHCPv6 client, DHCPv4 side
--------------------------------------

State machine (including startup and timeouts)
 |
send_<message_type>()
 |                  |
send_dhcpv4_query() |
 |   	            |
 V                  |
to DHCPv6 side      |
                   add_timeout() (for retry)

from DHCPv6 side
 |
dhcpv4o6_handler() (including DHCP4o6 IPC state machine)
 |
recv_dhcpv4_response()
 |
parse_options()
 |
bootp()/dhcp() (cf DHCPv4 client)

DHCPv4-over-DHCPv6 client, DHCPv6 side
--------------------------------------

I/O receive handler got_one_v6()
 |
do_packet6() (dhcpv6_packet_handler) (relayed, dhcpv4 or direct message)
 |
parse_option_buffer()
 |
dhcpv6()
 |
forw_dhcpv4_response() (when the message is a DHCPv4-response)
 |
to DHCPv4 side

from DHCPv4 side
 |
dhcpv4o6_handler() (including DHCP4o6 IPC state machine)
 |
forw_dhcpv4_query()
 |
send_packet6() to all DHCP4o6 server addresses or multicast

DHCPv4 server
-------------

I/O receive handler got_one()
 |
receive_packet()
 |
do_packet() (bootp_packet_handler)
 |               |
parse_options()  |
                 |
                bootp()/dhcp()
                 |
                locate_network()
                 |
                manage lease (find_lease*(), ...)
                 |         |
                dhcpxxx()  |
                          send_packet()

DHCPv6 server
-------------

I/O receive handler got_one_v6()
 |
receive_packet6()
 |
do_packet6() (dhcpv6_packet_handler) (relayed or direct message)
 |
parse_option_buffer()
 |
dhcpv6()
 |
build_dhcpv6_reply()
 |              |
send_packet6()  |
               dhcpv6_<message_type>()
                |
               valid_client_{msg,resp}()
                |
               lease_to_client()/start_reply()/...

DHCPv4-over-DHCPv6 server DHCPv4 side
-------------------------------------

from DHCPv6 side
 |
dhcpv4o6_handler()
 |
recv_dhcpv4_query()
 |
inline code from do_packet6(), e.g., parse_option_buffer()
 |
inline code from dhcpv6(), e.g., build_dhcpv6_reply()
 |
to DHCPv6 side

DHCPv4-over-DHCPv6 server DHCPv6 side
-------------------------------------

I/O receive handler got_one_v6()
 |
receive_packet6()
 |
do_packet6() (dhcpv6_packet_handler) (relayed or direct message)
 |
parse_option_buffer()
 |
dhcpv6()
 |
build_dhcpv6_reply() (relayed or direct message)
 |                   |
forw_dhcpv4_query()  |
 |                  dhcp4o6_relay_forw()
to DHCPv4 side       |
                    parse_option_buffer()
                     |
                    build_dhcpv6_reply() (recursive call)

from DHCPv6 side
 |
dhcpv4o6_handler()
 |
send_dhcpv4_response()
 |
send_packet6()