버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

  • Fact : 우수성과취합 검토까지 완료, P4 basic tunnel의 관련 문서들을 보고 작동 방식을 이해했다.
  • Feelings : 뭔가 배워가고 있다는 느낌이 든다.
  • Finding : 터널링에 대한 것을 처음 알았다. 
  • Future Action Plan : P4 runtime 이해
  • Feedbacks :

23/02/16

  • Fact : 
  • Feelings : 
  • Finding : 
  • Future Action Plan : 
  • Feedbacks :

Memo

23/02/13

...

출처

내용

배운 점 및 기억해야할 점

비고

과학데이터교육 텍스트데이터분석충북대 현장실습 직무교육
텍스트 데이터 분석 모델 평가 및 구현하기, 토픽별 필요 단어 분류, 긍정 및 부정 감성분석 사전 제작, 데이터 예측을 위한 머신러닝 기법11차시까지 수강

23/02/16

  • 참고사항
    • -

  • 동영상 참고

출처

내용

배운 점 및 기억해야할 점

비고

과학데이터교육 텍스트데이터분석충북대 현장실습 직무교육


배운 것 및 기억해야할 것

P4 튜토리얼 basic forwarding 예제

...

하지만 h1→h2로 ping을 s1의 2포트의 터널을 이용해서 보낸다면 ipv4의 헤더값에 관계없이 터널 헤더에 의해 h1->s1->s2→h2로 이동한다. 이말은 h1→h3으로 s1의 2포트의 터널을 이용해서 보낸다고 하더라도 ipv4헤더의 목적지인 h3(10.0.3.3)에 관계없이 h2에 도착하게 된다는 말이다.

P4 튜토리얼 P4runtime의 이해

P4runtime은 공식문서에서 "P4 프로그램에서 정의한 장치의 데이터 평면 요소를 관리하기 위한 제어 평면 사양입니다."라고 정의하고 있다. 즉, 이전 튜토리얼에서 sX-runtime.json파일을 사용해서 forwarding 테이블을 채워넣은 것과 다르게 runtime을 이용해서 동적으로 forwarding 테이블을 채워넣는 역할을 한다. 

advanced_tunnel.p4 을 이용해서 p4프로그램을 실행한 후에 h1 ping -c1 h2 명령을 실행한 다음의 s1스위치의 로그내용이다. 

코드 블럭
titleh1 ping -c1 h2 이후 s1 log (테이블항목 생성 전)
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Processing packet received on port 1
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser 'parser': start
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser 'parser' entering state 'start'
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Extracting header 'ethernet'
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser state 'start': key is 0800
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] Bytes parsed: 14
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser 'parser' entering state 'parse_ipv4'
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Extracting header 'ipv4'
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser state 'parse_ipv4' has no switch, going to default next state
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] Bytes parsed: 34
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Parser 'parser': end
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Pipeline 'ingress': start
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] advanced_tunnel.p4(169) Condition "hdr.ipv4.isValid() && !hdr.myTunnel.isValid()" (node_2) is true
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] Applying table 'MyIngress.ipv4_lpm'
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Looking up key:
* hdr.ipv4.dstAddr    : 0a000202

[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Table 'MyIngress.ipv4_lpm': miss //테이블이 채워지지 않았기 때문에 목적지인 h2의 ipAddr이랑 매치되는 내용이 없다 그래서 miss가 나고 noAction을 수행한다.
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Action entry is NoAction - 
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] Action NoAction
[01:20:20.365] [bmv2] [T] [thread 3033] [50.0] [cxt 0] advanced_tunnel.p4(174) Condition "hdr.myTunnel.isValid()" (node_4) is false
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Pipeline 'ingress': end
[01:20:20.365] [bmv2] [D] [thread 3033] [50.0] [cxt 0] Egress port is 0
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Pipeline 'egress': start
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Pipeline 'egress': end
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Deparser 'deparser': start
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Updating checksum 'cksum'
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Deparsing header 'ethernet'
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Deparsing header 'ipv4'
[01:20:20.365] [bmv2] [D] [thread 3034] [50.0] [cxt 0] Deparser 'deparser': end
[01:20:20.365] [bmv2] [D] [thread 3038] [50.0] [cxt 0] Transmitting packet of size 98 out of port 0

mycontroller.py을 이용해서 s1에 ingress rule과 egress rule을 추가한 후에 h1 ping -c1 h2 명령을 실행한 다음의 s1스위치의 로그내용이다. 

코드 블럭
titleh1 ping -c1 h2 이후 s1 log (테이블항목 생성 후)
[01:22:43.726] [bmv2] [W] [thread 3131] [P4Runtime] p4::tmp::P4DeviceConfig is deprecated
[01:22:43.728] [bmv2] [D] [thread 3131] Set default default entry for table 'MyIngress.ipv4_lpm': NoAction - 
[01:22:43.728] [bmv2] [D] [thread 3131] Set default default entry for table 'MyIngress.myTunnel_exact': MyIngress.drop - 
[01:22:43.730] [bmv2] [D] [thread 3131] simple_switch target has been notified of a config swap
[01:22:43.738] [bmv2] [D] [thread 3135] Entry 0 added to table 'MyIngress.ipv4_lpm'
[01:22:43.738] [bmv2] [D] [thread 3135] Dumping entry 0
Match key:
* hdr.ipv4.dstAddr    : LPM       0a000202/32
Action entry: MyIngress.myTunnel_ingress - 64,

[01:22:43.741] [bmv2] [D] [thread 3131] Entry 0 added to table 'MyIngress.myTunnel_exact'
[01:22:43.741] [bmv2] [D] [thread 3131] Dumping entry 0
Match key:
* hdr.myTunnel.dst_id : EXACT     00c8
Action entry: MyIngress.myTunnel_egress - 80000000111,1,
/**  s1에 ingress rule과 egress rule을 추가**/
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Processing packet received on port 1
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser 'parser': start
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser 'parser' entering state 'start'
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Extracting header 'ethernet'
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser state 'start': key is 0800
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Bytes parsed: 14
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser 'parser' entering state 'parse_ipv4'
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Extracting header 'ipv4'
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser state 'parse_ipv4' has no switch, going to default next state
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Bytes parsed: 34
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Parser 'parser': end
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Pipeline 'ingress': start
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(169) Condition "hdr.ipv4.isValid() && !hdr.myTunnel.isValid()" (node_2) is true
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Applying table 'MyIngress.ipv4_lpm'
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Looking up key:
* hdr.ipv4.dstAddr    : 0a000202

[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Table 'MyIngress.ipv4_lpm': hit with handle 0 //테이블에 항목이 추가되어 h2의 ipAddr와 hit
[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Dumping entry 0
Match key:
* hdr.ipv4.dstAddr    : LPM       0a000202/32
Action entry: MyIngress.myTunnel_ingress - 64,

[01:23:34.105] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Action entry is MyIngress.myTunnel_ingress - 64, //hit한 항목의 action인 myTunnel_ingress를 실행한다.
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Action MyIngress.myTunnel_ingress
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(122) Primitive hdr.myTunnel.setValid()
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(123) Primitive hdr.myTunnel.dst_id = dst_id
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(124) Primitive hdr.myTunnel.proto_id = hdr.ethernet.etherType
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(5) Primitive 0x1212; ...
[01:23:34.105] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(126) Primitive (bit<32>) hdr.myTunnel.dst_id
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(126) Primitive ingressTunnelCounter.count((bit<32>) hdr.myTunnel.dst_id)
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Updated counter 'MyIngress.ingressTunnelCounter' at index 100
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(174) Condition "hdr.myTunnel.isValid()" (node_4) is true
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Applying table 'MyIngress.myTunnel_exact'
[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Looking up key:
* hdr.myTunnel.dst_id : 0064

[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Table 'MyIngress.myTunnel_exact': miss //아직 tunnel의 전달 규칙 테이블이 추가되지 않았기 때문에 miss
[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Action entry is MyIngress.drop - 
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] Action MyIngress.drop
[01:23:34.106] [bmv2] [T] [thread 3033] [57.0] [cxt 0] advanced_tunnel.p4(111) Primitive mark_to_drop(standard_metadata)
[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Pipeline 'ingress': end
[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Egress port is 511
[01:23:34.106] [bmv2] [D] [thread 3033] [57.0] [cxt 0] Dropping packet at the end of ingress

Image Added

아직 tunnel 테이블에 항목을 추가하지 않았기 때문에 s1에 패킷이 들어가기만 하고 나오지 않은것을 확인할 수 있다.