12 erspan header version 1 type ii erspan version 1

  • No School
  • AA 1
  • 23

This preview shows page 12 - 19 out of 23 pages.

12
Image of page 12
ERSPAN Header – Version 1 (Type II) ERSPAN Version 1 (Type II) header (8 octets) 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ver | VLAN | COS | En|T| Session ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Index | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Original VLAN Class of Service VLAN Encap Type Truncated Platform Dependent 13
Image of page 13
ERSPAN Version 1 (Type II) Implementation Introduces two new iproute2 configurable fields to the netlink API. Session ID Index ERSPAN does not use GRE KEY so repurposes IFLA_GRE_IKEY, IFLA_GRE_OKEY for the Session ID. Index is also configurable via iproute2. COS and VLAN are extracted from original frame. Truncate bit is set if: Skb length is greater than device MTU + device hard_header_len IPv4 length is greater than skb length – network header offset IPv6 length is greater than skb length – transport header offset 14
Image of page 14
ERSPAN Header – Version 2 (Type III) ERSPAN Version 2 (Type III) header (12 octets) 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ver | VLAN | COS |BSO|T| Session ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SGT |P| FT | Hw ID |D|Gra|O| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Bad/Short Oversized Security Group Tag Payload Frame Type Ingress / Egress TS Granularity Optional Platform Subheader 15
Image of page 15
ERSPAN Version 2 (Type III) Implementation Introduces another two fields to kernel through netlink API. Hardware ID Direction - ingress or egress COS, BSO, and T fields can be extracted or inferred from the mirrored frame. Timestamp value is calculated by calling the kernel ktime_get_real() with 100 µs granularity – Only 100 µs is supported. SGT is hard coded to zero. Non-Ethernet mirrored packet is not supported, so FT is always 0 and P is set to 1. There is no implementation of sub-headers, so optional bit is zero. 16
Image of page 16
Cisco ERSPAN example We use Nexus 5000 switch and configure its ERSPAN tunnel on ports 11 and 12 as below monitor session 10 type erspan-source erspan-id 10 vrf default destination ip 192.168.1.1 source interface Ethernet1/11 both source interface Ethernet1/12 both no shut monitor erspan origin ip-address 192.168.1.2 global 17
Image of page 17
With openvswitch.ko # with 4.19-rc6+ kernel and iproute2-ss180813 # creating datapath named "mydp", attach veth1(port 1) $ ovs-dpctl add-dp mydp $ ovs-dpctl add-if mydp ovs-veth1 // connected to namespace ns0 peer veth1 # creating erspan dev named "myerspan" and attach # Note that OVS uses a lightweight tunnel with “external” keyword $ ip link add dev myerspan type erspan external $ ovs-dpctl add-if mydp myerspan # flow entry for port 1 to erspan tunnel $ ovs-dpctl add-flow mydp \ "in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),\ ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)" \ "set(tunnel(tun_id=20,dst=192.168.1.1,ttl=64,erspan(ver=2,dir=1,hwid=0x4),flags(df|key ))),2 Note that the OVS vswitchd daemon is not required for this case.
Image of page 18
Image of page 19

You've reached the end of your free preview.

Want to read all 23 pages?

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors