Skip to Content
BPF로 리눅스 관측 가능성 향상하기: 성능 분석과 네트워킹을 위한 고급 프로그래밍
book

BPF로 리눅스 관측 가능성 향상하기: 성능 분석과 네트워킹을 위한 고급 프로그래밍

by 류광, 데이비드 칼라베라, 로렌초 폰타나
May 2020
Beginner to intermediate
236 pages
5h 15m
Korean
Hanbit Media, Inc.
Content preview from BPF로 리눅스 관측 가능성 향상하기: 성능 분석과 네트워킹을 위한 고급 프로그래밍
7.3 XDP 프로그램의 검사
189
로그램 개발에서 가장 어려운 점일 것이다. 요즘 가상화 기술을 이용하면 실무용 환경과 동일
한 검사 환경을 만드는 것이 그리 어렵지 않지만, 그래도 애초에 실무용 환경이 복잡하면 검사
환경의 재현성과 프로그래밍 가능성이 제한되는 것이 사실이다. 게다가, 가상화 환경에서 빈번
하게 실행되는
XDP
프로그램의 성능을 분석할 때는 가상화 자체의 비용이 성능에 영향을 미
치기 때문에 검사의 효과가 떨어진다. 환경에 따라서는, 실제 패킷 처리에 드는 비용보다 가상
화가 유발하는 비용이 훨씬 클 수 있다.
다행히 리눅스 커널 개발자들이 이 문제의 해답을 내놓았다. 커널 개발자들은
XDP
프로그
램의 검사에 사용할 수 있는
BPF
_
PROG
_
TEST
_
RUN
라는 명령을 구현했다.
본질적으로
BPF
_
PROG
_
TEST
_
RUN
은 실행할
XDP
프로그램과 입력 패킷, 출력 패킷을 인수로
받는다. 이 명령은 주어진
XDP
프로그램을 실행해서 출력 패킷을 채우고
XDP
프로그램의 결
과 코드를 반환한다. 검사 코드에서는 그 출력 패킷과 결과 코드를 점검해서
XDP
프로그램이
예상대로 작동했는지 확인한다.
XDP
프로그램뿐만 아니라 소켓 필터 프로그램 (소켓 버퍼에
접근하는 )에도 이 검사 기법을 적용할 수 있다.
필요한 것을 모두 갖춘 예제를 간결한 코드로 구현하기 위해, 여기서는 파이썬과 파이썬의
표준 단위 검사 프레임워크를 사용한다.
7.3.1
파이썬 단위 검사 프레임워크를 이용한
XDP
프로그램 검사
이 예제에서는 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

컨테이너 보안: 컨테이너화된 응용 프로그램의 보안을 위한 개념, 이론, 대응법과 모범 관행까지

컨테이너 보안: 컨테이너화된 응용 프로그램의 보안을 위한 개념, 이론, 대응법과 모범 관행까지

류광, 리즈 라이스

Publisher Resources

ISBN: 9791162243053