PacketIn

The PacketIn message is a way for the switch to send a captured packet to the controller. There are two reasons why this might happen; there could be an explicit action as a result of a match asking for this behavior, or from a miss in the match tables, or a ttl error.
Initiator
Switch
Acknowledged
No

Structure

A PacketIn message consists of the header, followed by a buffer id. The buffer id is a unique value used to track the buffered packet. The length of the captured packet is indicated by total_len. The port the packet was recieved on is indicated by in_port. The reason field indicates why the packet has been captured and forwarded. Finally, the captured portion of the packet starts just beyond the pad.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
in_port 16 MSBF none
reason 8 - See Table
pad 8 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01

References

OpenFlow Switch Specification 1.0.0, page 36

Structure

In this version OpenFlow increased the port sizes from a 16 bit to a 32 bit unsigned number. The structure has been updated accordingly. Additionally, the field in_phy_port was added, which indicates the non-OpenFlow port the packet may have been recieved on.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
in_port 32 MSBF none
in_phy_port 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
data 64 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01

References

OpenFlow Switch Specification 1.1.0, page 50

Structure

In this version the port fields have been abdicated to the match structure. Additionally, an additional reason is added, InvalidTTL.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
match 32 MSBF Match restrictions
pad 16 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01
InvalidTTL 0x02

References

OpenFlow Switch Specification 1.2, page 59

Structure

This version adds an additional 64 bit field, called cookie, which is used to identify the specific flow that matched this packet.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
cookie 64 MSBF none
match 32 MSBF Match restrictions
pad 16 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01
InvalidTTL 0x02

References

OpenFlow Switch Specification 1.3.0, page 76

Structure

No changes were made from the previous version.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
cookie 64 MSBF none
match 32 MSBF Match restrictions
pad 16 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01
InvalidTTL 0x02

References

OpenFlow Switch Specification 1.3.1, pages 92-93

Structure

No changes were made from the previous version.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
cookie 64 MSBF none
match 32 MSBF Match restrictions
pad 16 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01
InvalidTTL 0x02

References

OpenFlow Switch Specification 1.3.2, pages 94-96

Structure

No changes were made from the previous version.

Message Structure

Name Bits Byte Ordering Constraints
buffer_id 32 MSBF none
total_len 16 MSBF none
reason 8 - See table
tbl_id 8 - none
cookie 64 MSBF none
match 32 MSBF Match restrictions
pad 16 - none
data 48 MSBF none

Message Constraints

Field Name Value
Reason NoMatch 0x00
Action 0x01
InvalidTTL 0x02

References

OpenFlow Switch Specification 1.3.3, pages 99-102

Coming soon
This content is under development.