Upgrade to Pro — share decks privately, control downloads, hide ads and more …

XDP as a Building Block of the Advanced L4 Load...

XDP as a Building Block of the Advanced L4 Load Balancers

2019/11/27に開催されたInternet Week 2019での登壇資料です

LINE Developers

November 27, 2019
Tweet

More Decks by LINE Developers

Other Decks in Technology

Transcript

  1. :VUBSP )BZBLBXB • 5XJUUFS!:VUBSP)BZBLBXB • +PJOFEUPUIF-*/&BTBOFXHSBEVBUFJOUIJTZFBS • "TB-*/&EFWFMPQFS • /FUXPSLEFWFMPQNFOUUFBN

    • %FWFMPQFS0QFSBUPSPGUIFJOUFSOBM-#BB4 • "TBOJOEJWJEVBMEFWFMPQFS • F#1' FOUIVTJBTU -PWF-JOVYLFSOFMOFUXPSLJOH • 1PSUUIFF#1' UPUIF'SFF#4%LFSOFM (4P$  9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB 
  2. 9%1JO-*/& 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB - - - - - - -

    ./ - ./ - - - - - - - - .7B 7B .7B 7B .7B 7B .7B 7B .7B 7B .7B 7B 0 1 : 73 7B67 7267 63 8 3B7 7 9 77B 9 :3 B 7 B 9 3 433 0 1 : 67 :3B7 7 7 B !
  3. 9%1 F9QSFTT %BUB1BUI  - D /D C AAC -

           DD :   - - - int xdp_program(struct xdp_md *ctx) { uint8_t *head = (uint8_t *)(long)(ctx->data); uint8_t *tail = (uint8_t *)(long)(ctx->data_end); struct eth *eth = (struct eth *)head; if (eth->type != htons(ETH_P_IP)) { return XDP_DROP; } return XDP_PASS; } A D - D 4 6 C D 6 D , DA D D CD D: A D A - CC D D: A D CD / 6 4 D D: CC 6 . 6 D D D: C CA C -: C 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  4. .BQT)FMQFSGVODUJPOT • .BQ,74UIBUDBOCFTIBSFECFUXFFOVTFS F#1' PSF#1'F#1' • "SSBZ.BQ )BTI.BQ 5SJF .BQ

    FUD • 6TFSTEPO`UIBWFUPDBSFBCPVUUIFMPDL • 7FSZMPXPWFSIFBE XIFOUIFZBSFVTFEGSPNF#1' • )FMQFSGVODUJPOT,FSOFMGVODUJPOTXIJDIDBOCF DBMMFEGSPNF#1' QSPHSBN • .BOJQVMBUFUIFNBQ • (FUUJNFTUBNQ • FUD FUD FUD ) ( ( )2 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  5. 0VS--#%BUB1MBOF ) 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB .AI E: " EA . "

    1 L I E A : I M E M B : E 4.2 6P 4ND IA D E 2 M B 4NI DI IA E E D D E A E 24 P ) ) 0(0, 4 L 4 L 4 L 3 , B E , B E , , B E 2 , B E 6 3 3 3 3 ) (
  6. 4FTTJPO$BDIJOH 4UBUFGVMBQQSPBDI 1 3 1 3 1 3 1 3

    1 3 ( ( ) ) ) ) 20 34 1 3 20 34 1 3 20 34 1 3 20 34 1 3 20 34 1 3 ( 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  7. 0VS4PMVUJPO • )FBWJMZJOTQJSFECZ,BUSBO <> • 5$14:/'MPPEJOHNJUJHBUJPO • .FBTVSFUIFSBUFPGUIF4:/QBDLFUT • 3BUFSFBDIFTUPUIFUISFTIPMEGBMMCBDL

    UPUIFTUBUFMFTTIBTIJOH • 4FTTJPODBDIFHBSCBHFDPSSFDUJPOXJUI -36)BTI.BQ ! / / 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB 4 1/ 11. 1 .
  8. F#1' -36.BQ  • .BQTXJUIBVUPNBUJD($CZ-36 -FBTU3FDFOUMZ6TFE BMHPSJUINT • "VUPNBUJDBMMZEFMFUFUIFNBQFOUSZ XIFOUIFNFNPSZFYIBVTUFE

    • 6TFSTEPO`UIBWFUPDBSFBCPVU NFNPSZVTBHF ( ) ( ) ( ) 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  9. -36.BQJT1BJOGVMʜ  • 5IFCFIBWJPSPGUIF($JTDPNQMJDBUFE • 'VMMBMHPSJUINEFTDSJQUJPO • IUUQTHJUIVCDPNUPSWBMETMJOVYDPNNJUBDGEB EEFEGFGCEJGG FFFBGCGGBF

    • ($NBZSVOPOQBDLFUQSPDFTTJOHQBUI • -BSHFQFSGPSNBODFQFOBMUZ • $BOOPUEPEZOBNJDUSBDJOH • -PPLVQGSPNVTFSTQBDFNBZBGGFDUUPUIF($CFIBWJPS • %FQFOETPOUIFLFSOFMWFSTJPO'JYFEJO 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  10. :FU"OPUIFS"QQSPBDIGPS'BJMPWFS 4 4 1 1 1 1 1 1 1

    1 235 3 1 0 4 1 4 4 4 4 4 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  11. :FU"OPUIFS"QQSPBDIGPS'BJMPWFS 0 2 0 2 0 2 0 2 0

    2 0 2 0 2 0 2 34 4 2 1 0 2 06 4 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  12. :FU"OPUIFS"QQSPBDIGPS'BJMPWFS 4 4 0 2 0 2 0 2 0

    2 0 2 0 2 0 2 0 2 347 4 2 1 4 0 2 4 0 9%1BTB#VJMEJOH#MPDLPGUIF"EWBODFE--PBE#BMBODFSTc:VUBSP )BZBLBXB
  13. :FU"OPUIFS"QQSPBDIGPS'BJMPWFS 4 0 2 0 2 0 2 0 2

    0 2 0 2 0 2 0 2 34 4 2 1 4 4 0 2 4 4 ! ! 0 4 4 4 4 9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