raw_socket의 사용 이유

익명 사용자의 이미지

udp와 tcp를 왜 사용하는지는 알고 있습니다..
근데 raw_socket은 사용 이유를 모르겠습니다..
답변 부탁합니다..

익명 사용자의 이미지

글쎄요.
일반적인 프로그램(통신상의 자료에 치중하는...)에서는 그냥 socket을
이용해서 프로그램을 작성하면 되겠죠.
하지만 커널단계나 시스템 분석단계의 프로그램을 작성하려면 socket보다는
좀더 많은 자료를 볼 수 있는 raw_socket을 사용하는게 좋겠죠.
즉, 일반 socket은 일반적인 게임, 메신저 등등의 프로그램에서 이용을 하게
될것이고 raw_socket은 iptables 같은 프로그램에서 이용이 되겠죠. ^^;

익명 사용자의 이미지

raw_socket
은 주로 IP header나 TCP header등 기본적인 packet정보를
만들때 이용을 많이 하는걸로 알고 있습니다.

즉 appl레벨에선 잘 안쓰지요..
물런 NMS관련된 appl인경우..는 쓰겠지여? ^^*

이상 허접 정보였슴댜아 ^^*

익명 사용자의 이미지

TCP, UDP 모두 IP 데이터그램에 캡슐화 된 채로 돌아다니죠..

하지만 IP 프로토콜을 이용하지 않는 프로토콜도 많이 있습니다.

(ARP, RARP 등)..

이와 관련된 프로그램을 구현하려면 raw_socket 이 필수입니다.

이 외에도, user level 에서의 패킷 분석에도 널리 사용됩니다.

익명 사용자의 이미지

raw socket을 쓰는 이유는 여러가지 있을 수 있지만
우리 생활에서 가장 많이 사용하는 ping이 raw socket으로
되어 있습니다.

이외에 natd, ipfillter, tcpdump등 많은 부분에서 사용하지요.

왜 사용하냐고요.
1. icmp/igmp는 raw socket밖에는 안되니까.
2. ip address나 tcp port등 network상에서
이동되는 모든 자료를 볼려면 이걸 쓸수 밖에 없으니까.
등.. 여러가지 이유로 사용합니다.(아마 할수밖에 없을걸요)

gunstar의 이미지

raw socket을 사용하는이유는 ethernet frame를 다룰수 있기 때문입니다. 기존의 socket을 사용하면 ip의 payload부분밖에 프로그램에서 다룰 수가 없습니다. 그렇기 때문에 raw socket을 사용합니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.