Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   ovs-fields    ( 7 )

поля заголовка протокола в OpenFlow и Open vSwitch (protocol header fields in OpenFlow and Open vSwitch)

LAYER 4: TCP, UDP, AND SCTP FIELDS

Summary: Name Bytes Mask RW? Prereqs NXM/OXM Support

─────────────────── ──────────────── ───── ──── ──────── ───────────────────── tcp_src aka tp_src 2 yes yes TCP OF 1.2+ and OVS 1.1+ tcp_dst aka tp_dst 2 yes yes TCP OF 1.2+ and OVS 1.1+ tcp_flags 2 (low 12 bits) yes no TCP OF 1.3+ and OVS 2.1+

udp_src 2 yes yes UDP OF 1.2+ and OVS 1.1+ udp_dst 2 yes yes UDP OF 1.2+ and OVS 1.1+ sctp_src 2 yes yes SCTP OF 1.2+ and OVS 2.0+ sctp_dst 2 yes yes SCTP OF 1.2+ and OVS 2.0+

For matching purposes, no distinction is made whether these protocols are encapsulated within IPv4 or IPv6.

TCP The following diagram shows TCP within IPv4. Open vSwitch also supports TCP in IPv6. Only TCP fields implemented as Open vSwitch fields are shown:

Ethernet IPv4 TCP <-----------> <---------------> <-------------------> 48 48 16 8 32 32 16 16 12 +---+---+-----+ +---+-----+---+---+ +---+---+---+-----+---+ |dst|src|type | |...|proto|src|dst| |src|dst|...|flags|...| ... +---+---+-----+ +---+-----+---+---+ +---+---+---+-----+---+ 0x800 6

TCP Source Port Field

Name: tcp_src (aka tp_src) Width: 16 bits Format: decimal Masking: arbitrary bitwise masks

Prerequisites: TCP Access: read/write OpenFlow 1.0: yes (exact match only) OpenFlow 1.1: yes (exact match only)

OXM: OXM_OF_TCP_SRC (13) since OpenFlow 1.2 and Open vSwitch 1.7 NXM: NXM_OF_TCP_SRC (9) since Open vSwitch 1.1

Open vSwitch 1.6 added support for bitwise matching.

TCP Destination Port Field

Name: tcp_dst (aka tp_dst) Width: 16 bits Format: decimal

Masking: arbitrary bitwise masks Prerequisites: TCP Access: read/write OpenFlow 1.0: yes (exact match only) OpenFlow 1.1: yes (exact match only)

OXM: OXM_OF_TCP_DST (14) since OpenFlow 1.2 and Open vSwitch 1.7 NXM: NXM_OF_TCP_DST (10) since Open vSwitch 1.1

Open vSwitch 1.6 added support for bitwise matching.

TCP Flags Field

Name: tcp_flags Width: 16 bits (only the least-significant 12 bits may be nonzero) Format: TCP flags

Masking: arbitrary bitwise masks Prerequisites: TCP Access: read-only OpenFlow 1.0: not supported OpenFlow 1.1: not supported

OXM: ONFOXM_ET_TCP_FLAGS (42) since OpenFlow 1.3 and Open vSwitch 2.4; OXM_OF_TCP_FLAGS (42) since OpenFlow 1.5 and Open vSwitch 2.3 NXM: NXM_NX_TCP_FLAGS (34) since Open vSwitch 2.1

This field holds the TCP flags. TCP currently defines 9 flag bits. An additional 3 bits are reserved. For more information, see [RFC 793], [RFC 3168], and [RFC 3540].

Matches on this field are most conveniently written in terms of symbolic names (given in the diagram below), each preceded by either + for a flag that must be set, or - for a flag that must be unset, without any other delimiters between the flags. Flags not mentioned are wildcarded. For example, tcp,tcp_flags=+syn-ack matches TCP SYNs that are not ACKs, and tcp,tcp_flags=+[200] matches TCP packets with the reserved [200] flag set. Matches can also be written as flags/mask, where flags and mask are 16-bit numbers in decimal or in hexadecimal prefixed by 0x.

The flag bits are:

reserved later RFCs RFC 793 <---------------> <--------> <---------------------> 4 1 1 1 1 1 1 1 1 1 1 1 1 +----+-----+-----+-----+--+---+---+---+---+---+---+---+---+ |zero|[800]|[400]|[200]|NS|CWR|ECE|URG|ACK|PSH|RST|SYN|FIN| +----+-----+-----+-----+--+---+---+---+---+---+---+---+---+ 0

UDP The following diagram shows UDP within IPv4. Open vSwitch also supports UDP in IPv6. Only UDP fields that Open vSwitch exposes as fields are shown:

Ethernet IPv4 UDP <-----------> <---------------> <---------> 48 48 16 8 32 32 16 16 +---+---+-----+ +---+-----+---+---+ +---+---+---+ |dst|src|type | |...|proto|src|dst| |src|dst|...| ... +---+---+-----+ +---+-----+---+---+ +---+---+---+ 0x800 17

UDP Source Port Field

Name: udp_src

Width: 16 bits Format: decimal Masking: arbitrary bitwise masks Prerequisites: UDP Access: read/write

OpenFlow 1.0: yes (exact match only) OpenFlow 1.1: yes (exact match only) OXM: OXM_OF_UDP_SRC (15) since OpenFlow 1.2 and Open vSwitch 1.7 NXM: NXM_OF_UDP_SRC (11) since Open vSwitch 1.1

UDP Destination Port Field

Name: udp_dst Width: 16 bits Format: decimal

Masking: arbitrary bitwise masks Prerequisites: UDP Access: read/write OpenFlow 1.0: yes (exact match only) OpenFlow 1.1: yes (exact match only)

OXM: OXM_OF_UDP_DST (16) since OpenFlow 1.2 and Open vSwitch 1.7 NXM: NXM_OF_UDP_DST (12) since Open vSwitch 1.1

SCTP The following diagram shows SCTP within IPv4. Open vSwitch also supports SCTP in IPv6. Only SCTP fields that Open vSwitch exposes as fields are shown:

Ethernet IPv4 SCTP <-----------> <---------------> <---------> 48 48 16 8 32 32 16 16 +---+---+-----+ +---+-----+---+---+ +---+---+---+ |dst|src|type | |...|proto|src|dst| |src|dst|...| ... +---+---+-----+ +---+-----+---+---+ +---+---+---+ 0x800 132

SCTP Source Port Field

Name: sctp_src Width: 16 bits Format: decimal Masking: arbitrary bitwise masks Prerequisites: SCTP Access: read/write

OpenFlow 1.0: not supported OpenFlow 1.1: yes (exact match only) OXM: OXM_OF_SCTP_SRC (17) since OpenFlow 1.2 and Open vSwitch 2.0 NXM: none

SCTP Destination Port Field

Name: sctp_dst Width: 16 bits Format: decimal Masking: arbitrary bitwise masks Prerequisites: SCTP

Access: read/write OpenFlow 1.0: not supported OpenFlow 1.1: yes (exact match only) OXM: OXM_OF_SCTP_DST (18) since OpenFlow 1.2 and Open vSwitch 2.0 NXM: none