| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: mpls.4,v 1.5 2011/07/03 07:00:47 kefren Exp $ | | 1 | .\" $NetBSD: mpls.4,v 1.6 2011/07/03 09:10:37 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2010 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2010 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
| @@ -65,33 +65,33 @@ sized | | | @@ -65,33 +65,33 @@ sized |
65 | .Dq shim | | 65 | .Dq shim |
66 | that precedes any network layer headers, just after data | | 66 | that precedes any network layer headers, just after data |
67 | link layer headers. | | 67 | link layer headers. |
68 | .Ss MPLS shim header structure | | 68 | .Ss MPLS shim header structure |
69 | In network bit order: | | 69 | In network bit order: |
70 | .Bd -literal | | 70 | .Bd -literal |
71 | ------------------------------------------- | | 71 | ------------------------------------------- |
72 | | | | | | | | 72 | | | | | | |
73 | | Label | Exp. | BoS | TTL | | | 73 | | Label | Exp. | BoS | TTL | |
74 | | 20 bits | 3 bits | 1 bit | 8 bits | | | 74 | | 20 bits | 3 bits | 1 bit | 8 bits | |
75 | | | | | | | | 75 | | | | | | |
76 | ------------------------------------------- | | 76 | ------------------------------------------- |
77 | .Ed | | 77 | .Ed |
78 | .Bl -tag -width "Bottom of stack" | | 78 | .Bl -tag -width "Bottom of Stack" |
79 | .It Label | | 79 | .It Label |
80 | 20 bits representing FEC, consequently the only information | | 80 | 20 bits representing FEC, consequently the only information |
81 | used to forward the frame to next-hop | | 81 | used to forward the frame to next-hop |
82 | .It Experimental | | 82 | .It Experimental |
83 | 3 bits that are sometimes used for specifying a type of service | | 83 | 3 bits that are sometimes used for specifying a type of service |
84 | .It Bottom of stack | | 84 | .It Bottom of Stack |
85 | 1 bit that is set for the last entry in the shim | | 85 | 1 bit that is set for the last entry in the shim |
86 | stack and 0 for all others. | | 86 | stack and 0 for all others. |
87 | This way, multiple labels can | | 87 | This way, multiple labels can |
88 | be prepended to a single packet. | | 88 | be prepended to a single packet. |
89 | .It TTL | | 89 | .It TTL |
90 | 8 bits, representing Time to Live, decremented at every LSR. | | 90 | 8 bits, representing Time to Live, decremented at every LSR. |
91 | .El | | 91 | .El |
92 | .Sh USAGE | | 92 | .Sh USAGE |
93 | The MPLS behavior is controlled by the | | 93 | The MPLS behavior is controlled by the |
94 | .Li net.mpls | | 94 | .Li net.mpls |
95 | .Xr sysctl 8 | | 95 | .Xr sysctl 8 |
96 | tree: | | 96 | tree: |
97 | .Bl -tag -width "net.mpls.inet6_map_prec" | | 97 | .Bl -tag -width "net.mpls.inet6_map_prec" |
| @@ -210,27 +210,27 @@ address for local generated packets. | | | @@ -210,27 +210,27 @@ address for local generated packets. |
210 | .Bd -literal | | 210 | .Bd -literal |
211 | # route add 10.0.0.0/8 -ifa 192.168.1.180 -ifp mpls0 -tag 25 -inet 192.168.1.100 | | 211 | # route add 10.0.0.0/8 -ifa 192.168.1.180 -ifp mpls0 -tag 25 -inet 192.168.1.100 |
212 | .Ed | | 212 | .Ed |
213 | For the latter example, setting an IP address for the mpls0 interface | | 213 | For the latter example, setting an IP address for the mpls0 interface |
214 | is not necessary. | | 214 | is not necessary. |
215 | .It | | 215 | .It |
216 | Route MPLS packets encapsulated with label 60 to 192.168.1.100 and POP label | | 216 | Route MPLS packets encapsulated with label 60 to 192.168.1.100 and POP label |
217 | .Bd -literal | | 217 | .Bd -literal |
218 | # route add -mpls 60 -tag 3 -inet 192.168.1.100 | | 218 | # route add -mpls 60 -tag 3 -inet 192.168.1.100 |
219 | .Ed | | 219 | .Ed |
220 | .It | | 220 | .It |
221 | Route IP packets into MPLS domain and prepend more tags | | 221 | Route IP packets into MPLS domain and prepend more tags |
222 | .Bd -literal | | 222 | .Bd -literal |
223 | # route add 10/8 -ifa 192.168.1.200 -ifp mpls0 -tag 20,30,40 -inet 192.168.1.100 | | 223 | # route add 10/8 -ifa 192.168.1.200 -ifp mpls0 -tag 20,30,40 -inet 192.168.1.100 |
224 | .Ed | | 224 | .Ed |
225 | For the above example, tag 20 will be inserted at Bottom of Stack, while tag 40 | | 225 | For the above example, tag 20 will be inserted at Bottom of Stack, while tag 40 |
226 | will be set into the outermost shim. | | 226 | will be set into the outermost shim. |
227 | .It | | 227 | .It |
228 | Replace label 60 with label 30, prepend two more labels: 40 and 41 (in this order) | | 228 | Replace label 60 with label 30, prepend two more labels: 40 and 41 (in this order) |
229 | and forward the result to 192.168.1.100 | | 229 | and forward the result to 192.168.1.100 |
230 | .Bd -literal | | 230 | .Bd -literal |
231 | # route add -mpls 60 -tag 30,40,41 -inet 192.168.1.100 | | 231 | # route add -mpls 60 -tag 30,40,41 -inet 192.168.1.100 |
232 | .Ed | | 232 | .Ed |
233 | .El | | 233 | .El |
234 | .Sh SEE ALSO | | 234 | .Sh SEE ALSO |
235 | .Xr netstat 1 , | | 235 | .Xr netstat 1 , |
236 | .Xr route 4 , | | 236 | .Xr route 4 , |