王子健 Overview LAN 1LAN 2.

Slides:



Advertisements
Similar presentations
1 生物計算期末作業 暨南大學資訊工程系 2003/05/13. 2 compare f1 f2  只比較兩個檔案 f1 與 f2 ,比完後將結果輸出。 compare directory  以兩兩比對的方式,比對一個目錄下所有檔案的相 似程度。  將相似度很高的檔案做成報表輸出,報表中至少要.
Advertisements

Software Engineering for Digital Home 單元 2 :軟體處理程序與需求分析 2-3 需求工程處理程序 Presenter: Away.
建立使用案例敘述 --Use Case Narrative
 課程網頁 :  講師姓名 : 張苑 ( ㄩㄢˋ ) 瑩  實驗室 : 資電館 734 室 
T-SQL 運算子介紹 11/29. 運算子的總類 指定運算子 算術運算子 比較運算子 邏輯運算子 位元運算子 字串連結運算子 單一運算元運算子.
Mobile IP Lab TA: 洪敏書
數位學習經驗分享 「 E 化教學教室與虛擬攝影棚」推廣經驗分享暨觀摩 高高屏活動 義守大學應用數學系郎正廉.
Technical Information Services of NCCU 政 大 資 訊 設 備 ( Powered by NCCU Student Ambassadors ) 劉 謙 Harrison 游逸凡 Rudy 黃予涵 Shahad.
SIP Mobiity TA: 洪敏書
在 Ad-hoc 網路中實現點對 點發送訊息與廣播訊息. 檔案下載  範例程式可在下列網址取得  DEMO 程式可在下列網址取得
Review of Chapter 3 - 已學過的 rules( 回顧 )- 朝陽科技大學 資訊管理系 李麗華 教授.
國立清華大學資訊工程學系 資訊工程系 2009/11/24P-1 Midterm & Solution 09810CS_ Computer Systems & Application.
1 真理大學運輸管理學系 實務實習說明 目錄  實務實習類別  實務實習條例  校外實習單位  實務實習成績計算方式  校外實習甄選 / 自洽申請流程  附錄:相關表格.
Graph V(G 1 )={0, 1, 2, 3, 4, 5, 6, 7, 8, 9} E(G 1 )={(0, 2), (0, 3), (1, 4), (2, 3), (2, 5), (2, 6), (3, 6), (3, 7), (4, 7), (5, 6), (5,
1 實驗二 : SIP User Mobility 實驗目的 藉由 Registra 和 Redirect Server 的設計,深入瞭解 SIP 的運 作及訊息格式。 實作部分 ( 1 )實作一個 Registrar 來接收 SIP REGISTER ,而且 要將 REGISTER 中 Contact.
1 實驗一 網路線的製作 一對一 (Straight-Through) 與 扭接 (Crossover) 的網路線製作.
第十二章網路規劃與建置. 前言 網路環境的建置必須取決於良好的規劃,一個好的規 劃則必須要有一個清楚的目標。目標的制訂,絕對不是運 用一切最新的網路技術來建置網路環境,而是必須先清楚 瞭解使用者的需求,因為建置網路的目的,絕對不是因為 要有網路而建置網路,應該是使用者的需求必須要經由網 路來達成,因此而建置網路。在明確的目標被訂定出來後,
1 網路同步學習 如何使用中山大學管理學院知識管理平台 愷中 製作. 2 如何登入中山大學網路學習平台 1. 首先, 請輸入 2. 點選申請帳號, 依照螢幕所示, 輸入個人資訊.
1 Introduction to Java Programming Lecture 4 Using JOptionPane Spring 2008.
Department of Air-conditioning and Refrigeration Engineering/ National Taipei University of Technology 模糊控制設計使用 MATLAB 李達生.
Network Connections ★★★☆☆ 題組: Contest Archive with Online Judge 題號: Network Connections 解題者:蔡宗翰 解題日期: 2008 年 10 月 20 日 題意:給你電腦之間互相連線的狀況後,題.
1 Lab 6 D2E Design Platform Introduction FPGA Design Platform.
Chapter 13 塑模靜態觀點:物件圖 Static View : Object Diagram.
1 第十四章 職業道德 職業道德是一個人在行業工作內表現的道德 情操. 2 職業道德貴在實踐 3 學習目標  了解職業道德的意義  了解職業道得的重要性  遵守職業道德規範.
國立中央大學電機工程學系 99 學年度第 2 學期 助教會議 中央大學電機工程學系 工程認證 1.
最新計算機概論 第 5 章 系統程式. 5-1 系統程式的類型 作業系統 (OS) : 介於電腦硬體與 應用軟體之間的 程式,除了提供 執行應用軟體的 環境,還負責分 配系統資源。
© The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 Chapter 7 位址解析通訊協定及 反向位址解析通訊協定.
電腦安全防護 ─ 基礎課程 Presentation by 張維廷 資訊中心 教學支援組. 個人電腦安全 個人電腦安全可分為兩個層面: 系統安全 資料安全 孰輕孰重 ?
© The McGraw-Hill Companies, Inc., 2006© The McGraw-Hill Companies, Inc., 2007 Chapter 3 底層技術.
EBooks 使用手冊. eBook Features 每本書可同時 6 人閱讀 每本書閱讀時間為 2 小時 全文閱讀器為 DX Reader ( 不需下載安裝 ) 提供個人化功能: Highlights ( 畫重點 ) Annotations ( 加註解 ) Bookmark ( 書籤 ) Research.
North Point Government Primary PM School 北角官立下午小學 應用 ‘ 基本能力學生評估 ’ 及 ‘ 網上學與教支援系統 ’ 經驗分享.
實驗六 WLAN 的設定 WLAN card 的設定. Reference Wireless Local Area Network by Dr.Morris Chang.
教材名稱:網際網路安全之技術及其應用 (編號: 41 ) 計畫主持人:胡毓忠 副教授 聯絡電話: 教材網址: 執行單位: 政治大學資訊科學系.
從此處輸入帳號密碼登入到管理頁面. 點選進到檔案管理 點選「上傳檔案」上傳資料 點選瀏覽選擇電腦裡的檔案 可選擇公開或不公開 為平台上的資料夾 此處為檔案分類,可顯示在展示頁面上,若要參加 MY EG 競賽,做品一律上傳到 “ 98 MY EG Contest ” 點選此處確定上傳檔案.
資料結構實習-一 參數傳遞.
1 libpcap Packet Sniffing for Security Alisa Neeman.
Department of Electrical Engineering, National Central University DIC Homework#1.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2008.
Multi - Language 鄭傑仁 陳彥如. Preface 大三下時,經由系上安排進入一間製作 IP phone 的公司實 習,公司所生產的 IP phone 提供很廣泛的設定 ( 例如 : 韌體 資訊、網路設定、 SIP 設定、語音設定等 ) ,為了方便使用 者設定或查詢這些選項,話機本身都內建了.
09810ENGI 校園網頁服務介紹 講師 : 張智宏. Outline 校務資訊系統  教學意見  密碼維護  校園軟體下載 網路系統組  網際網路服務  學生宿舍網路  無線網路  新生入學  線上服務.
Network Analyzer For Ethereal. 基本設備 Hardware pc network card can connect INTERNET Software OS Winpcap Ethereal.
網路連結 Internetworking.
網路介紹及其運用 講師陳炯勳. 5-2 IP 協定 ( 一 ) IP 協定運作 (1) – 網路成員:主機 (Host) 與路由器 (Router) – 路由表 – 電報傳輸運作.
概念性產品企劃書 呂學儒 李政翰.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2009.
ArcINFO &Geodatabase 由 ESRI 產生 1970 ArcINFO 一開始被設計在迷你電 腦上, 後來逐漸發展, 在 UNIX 系統上也能 執行, 直到今天, 已經可以在不同的平台上 運作.
09610CS_ 校園授權軟體下載與安裝 講師 : 張智宏. 登入校務資訊系統 校園軟體下載.
指導教授 : 林啟芳 教授 組員 : 邱秉良 林育賢. 何謂 GPS  GPS 即全球定位系統,是一個中距離圓 型軌道衛星導航系統。它可以為地球表面 絕大部分地區( 98% )提供準確的定位、 測速和高精度的時間標準。
Visual C++重點複習.
資料結構實習-六.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2010.
實體關係模型 (ER Model).
著作權所有 © 旗標出版股份有限公司 第 14 章 製作信封、標籤. 本章提要 製作單一信封 製作單一郵寄標籤.
遠端北風資料庫 公佈時間: 2006/4/26 繳交截止時間: 2006/5/10. 作業目的 實作遠端資料庫瀏覽程式.
POSTECH DP&NM Lab. Internet Traffic Monitoring and Analysis: Methods and Applications (1) Programming with Libpcap.
Lab-4 ICMP Ping Programming Speaker : Yi-Fong Lin Date:
CS4231 Local Area Networks HW1 – IP Packet Sniffer
Agostinho L S Castro Telecommunications and Multimedia Unit BPF - BSD Packet Filter.
Overview LAN 1LAN 2 Summary 目的 連接 LAN1 與 LAN2 Frame forwarding Frame filtering Hint Data link layer socket programming Library: libpcap libnet.
TamKang University Computer Science and Information Engineering Member: 林玫君 資工 3D 李俊毅 資工 2B 陳 懷 資工 2B 李承恩 資工 2B 指導老師 : 石貴平, 張志勇 助教 : Kevin Chang.
資料通訊與電腦網路原理 資料傳輸線路的傳遞模式 資料於傳輸線路的移動 並列傳輸、序列傳輸 基頻、寬頻.
作者: WEBCOLLAB 日期: 2007/11/22 Content Management Systems 實例簡介.
Trusted Video Management Lenel Onguard on Crystal.
NCTUns Emulation 指導教授:潘仁義 報告者:李詩涵、蕭惠陽. Kernel Re-entering Simulation Methodology  Tunnel 網路介面是實現 Kernel Re-entering Simulation Methodology 的關鍵技術  Tunnel.
Internet Technology Laboratory Department of Computer and Communication Kun Shan University  官方網站:
Java Just-In-Time Compiler in hand-held system 指導教授 單智君老師 指導教授 單智君老師 李政仲 張淳恩 王信安.
Lab 1 Introduction MMLAB. Environment Install Linux OS in a computer( VirtualBox or Vmware or Native) It’s all up to you for selecting Ubuntu Server or.
Tutorial 4. In this tutorial session we’ll see Threads.
Virtual Machine之軟體介紹與評比
Tutorial 4.
Presentation transcript:

王子健

Overview LAN 1LAN 2

Summary 目的 連接 LAN1 與 LAN2 Frame forwarding Frame filtering Hint Data link layer socket programming Library: libpcap libnet

Bridge Layer 2 network device Connect 2 LAN

Network API - libpcap libpcap (Packet CAPture) provides a portable framework for low-level network monitoring. Applications include network statistics collection, security monitoring, network debugging, etc. libpcap is the library we are going to use to grab packets right as they come off of the network card Tutorial

Libpcap - Functions pcap_t * pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf) int pcap_dispatch(pcap_t *p, int cnt, pcap_handler callback, u_char *user)

libpcap - Open up NIC for PCAP dev = pcap_lookupdev(errbuf); // 亦可寫成 dev = “eth0” If (dev == NULL) { fprintf(stderr,“%s\n”, errbuf); return -1; } descr = pcap_open_live(dev, BUFSIZ, promisc, pcap_time_out, errbuf); If (descr == NULL) { printf(“pcap_open_live(): %s\n”, errbuf); return -1; }

libpcap - Capture a Packet int ret; ret = pcap_dispatch( pt_a, 0, dev_a_handle, NULL); if ( ret == -1 ) { pcap_perror( pt_a, "pcap_dispatch err:"); } void dev_a_handle( u_char *devId, const struct pcap_pkthdr *hdr, const u_char *packet )

Network API - libnet Designed by Mike Schiffman, libnet is a portable, open source, C-language library for creating and injecting network packets. libnet supports packet creation at all network levels with the TCP/IP network model.

libnet - Functions libnet_t *libnet_init(int injection_type, char *device, char *err_buf); int libnet_write_link(struct libnet_link_int *l, const u_char *device, u_char *packet, int packet_size);

libnet - Initialization net_b = libnet_init( LIBNET_LINK, "eth0", errbuf ); if( net_a == NULL ) { fprintf(stderr, "libnet_init fail:%s ", errbuf ); return; }

libnet - Send a Packet c = libnet_write_link( net_b, (u_char*)packet, hdr->caplen );

pthread int pthread_create(pthread_t * thread, const pthread_attr_t * attr, void * (*start_routine)(void *), void *arg); thread - returns the thread id. (unsigned long int defined in bits/pthreadtypes.h) attr - Set to NULL if default thread attributes are used. void * (*start_routine) - pointer to the function to be threaded. Function has a single argument: pointer to void. *arg - pointer to argument of function. To pass multiple arguments, send a pointer to a structure.

pthread int pthread_join(pthread_t * thread, void **value_ptr); The pthread_join() function suspends execution of the calling thread until the target thread terminates

libpcap, libnet Installation libpcap sudo apt-get install libpcap0.8-dev libnet sudo apt-get install libnet1-dev Remember to Install these two library first

Programming Environment You have to write your program on Linux platform. You can install VMware to run Linux on it.

Environment Construction 一台有兩張網卡的電腦 (PC_E) 其他電腦用連接至 PC_E PC_E 需安裝 Linux 作業系統以及 libpcap, libnet 亦可在 Windows 下使用 VMware 安裝 Linux 代替 PC_E 仍須兩張網路卡 使 Virtual Machine 的兩張虛擬網路卡分別橋接至兩張實 體網路卡

Edit VM Setting

Add a Ethernet Card 建立兩個 subnet

Add a Ethernet Card

兩張網卡分別對 應到 eth0, eth1

Bridge Guest NIC to Host NIC 兩張網卡分別 bridged 到 VMnet2, VMnet3

Requirements 秀出 bridge 的 filtering database ( 工作站位址, 隸屬埠, 登錄時間 ) 同一個 LAN 互傳 ( 該兩台電腦都已經被 bridge 學習了 ) 時,另一 LAN 不應該收到封包 兩邊的 LAN 可以互通

Debugging

Grading Correctness (60%) Report (30%) How to run your program. What you’ve learned? What are you suffer from this HW? Any feedback? Coding Style (10%)

Hand in your program Deadline: 2009/-/- PM 23:59:59 Write a simple report in text file. Please tar/zip/rar your files (including code and report) named as 學號.tar (ex: tar) and login to ftp:// :4231, cs4231/cs4231s09 Change directory to Project2_upload and create a directory named your 學號, then upload your file in this directory.

Appendix libpcap / libnet pthread eads.html