1 / 15

Jc-patch の実装

Jc-patch の実装. Jc-patch 概要 BSDOS2.1→FreeBSD2.2.8 FreeBSD2.2.8→FreeBSD3.3. Jc-patch の概要. BSDOS2.1 RiscomN1 を使用 昔、西田さんが書いた 衛星ネットワークで送信者が特定の相手だけにデータを送るために利用. 衛星ネットワーク. PCからはシリアル通信 データリンクプロトコルはHDLC 受信者はすべてのデータを受け取る. IPアドレスをデータリンクアドレスに利用. IPパケットを ether_header でカプセリング

liko
Download Presentation

Jc-patch の実装

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jc-patchの実装 Jc-patch概要 BSDOS2.1→FreeBSD2.2.8 FreeBSD2.2.8→FreeBSD3.3

  2. Jc-patchの概要 • BSDOS2.1 • RiscomN1を使用 • 昔、西田さんが書いた • 衛星ネットワークで送信者が特定の相手だけにデータを送るために利用

  3. 衛星ネットワーク • PCからはシリアル通信 • データリンクプロトコルはHDLC • 受信者はすべてのデータを受け取る

  4. IPアドレスをデータリンクアドレスに利用 • IPパケットをether_headerでカプセリング • Mac addressの代わりにIPアドレスをsrc,dstに挿入し、残り2バイトをpadding

  5. パケットヘッダ ip header Src Dst データ 先頭2byteを0でパディング Src Dst type Src Dst データ

  6. 何故、今JCが必要か • UDLRのdraftがmac addressや、src,dstを持つデータリンクヘッダを前提としている • Draft-orientedなUDLRの実験に必要 • UDLRで運用されるAIIIに必要

  7. UDLR概要 UDLに送信する パケットを トンネリング ブロードキャストエミュレーション UDL 脱カプセル化し データリンク パケットを UDLに送信 Receiver Receiver Receiver Feeder BDL Internet

  8. BSDOS2.1→FreeBSD2.2.8への移植 • Attach,detachルーチンの書き替え • RisomN2のデバイスドライバへjcルーチンの呼び出し部分を追加 • Bpfで吸い上げるレイヤが違う

  9. BSDOSでのPoint-to-point protocol struct p2pcom { struct ifnet p2p_if; /* network-visible interface */ int p2p_oldflags; /* the old flags */ int (*p2p_input) __P((struct p2pcom *, struct mbuf *)); int (*p2p_modem) __P((struct p2pcom *, int)); /* modem event */ int (*p2p_mdmctl) __P((struct p2pcom *, int)); /* modem control */ int (*p2p_hdrinput) __P((struct p2pcom *, u_char *, int)); struct p2pprotosw *p2p_proto; int p2p_type; /* current type */ struct ifqueue p2p_isnd; /* queue for interactive packets */ struct p2pcom *p2p_next; /* next structure in protocol's list */ struct p2pcom **p2p_prevp; /* prev. structure in protocol's list */ struct mbuf *p2p_ibuf; /* input mbuf */ void *p2p_private; /* protocol private data */ };

  10. どのへんが違ったか BSDOS FreeBSD Ip layer Ip layer p2pcom{ Ifnet{ if_output()→jc_output if_init() ….. } p2p_input()   →jc_input() p2p_output() →jc_output() p2p_shutdown() →jc_shutdown() p2p_attach() →jc_attach() p2p_detach() →jc_detach() jc_attach() jc_detach() jc_output() Device driver Device driver

  11. Bpfへのtap • BSDOSはリンクレイヤでtap -リンクレイヤがそれぞれbpfへのtapルーチンを持つ • FreeBSDはcardのドライバでtap -tapルーチンはbpf_mtap()1つ -cardのattach時にbpf_attach()を呼び、tapする時にヘッダ長など必要な情報を取得 -普通、cardごとにデータリンクプロトコルは1つなので、Struct bpfの情報はattachされておわり。 -HDLCではppp_header,JCではether_headerを使用するので、attachされたデータリンクプロトコルごとにstruct bpfの内容を書きかえるルーチンを追加

  12. bpf struct bpf_if { struct bpf_if *bif_next; /* list of all interfaces */ struct bpf_d *bif_dlist; /* descriptor list */ u_int bif_dlt; /* link layer type */ u_int bif_hdrlen; /* length of header (with padding) */ struct ifnet *bif_ifp; /* corresponding interface */ };

  13. FreeBSD2.2.8→FreeBSD3.3への移植 • Ifnet{ Struct ifaddr *ifaddrlist FreeBSD2.2.8 Struct ifaddrhead *ifaddrhead FreeBSD3.3 マクロでアドレスを取り出す • Optionの追加がちょこっと違った

  14. FreeBSD2.2.8→FreeBSD3.3への移植 • フロッピー2枚のインストールがめんちゃい • Kernelがでかくてmakeが長い • Icmp_bmcastechoってなによ!

  15. 今後の予定 • 3.3FreeBSDへUDLRを移植し、JC上で動作させる • JC+UDLRルータをAIIIで運用する • Ipv6への対応 • 3.3がftpサイトから無くなる前に、次のversionに移植する。

More Related