導航:首頁 > 視頻設計 > 網路教學平台設計與實現

網路教學平台設計與實現

發布時間:2020-12-24 11:36:42

Ⅰ 【c++ 課程設計】 簡單的網路嗅探器 目的與要求:實現網路層抓包,並對獲得包的源和目的地址、埠、協議等

#include <winsock2.h> /*windows socket的頭文件,系統定義的*/
#include <windows.h>
#include <ws2tcpip.h>
#include <stdio.h>
#include <stdlib.h>
#pragma comment(lib,"ws2_32.lib") /*鏈接API相關連的Ws2_32.lib靜態庫*/
#define MAX_HOSTNAME_LAN 255
#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
#define MAX_ADDR_LEN 16

struct ipheader {
unsigned char ip_hl:4; /*header length(報頭長度)*/
unsigned char ip_v:4; /*version(版本)*/
unsigned char ip_tos; /*type os service服務類型*/
unsigned short int ip_len; /*total length (總長度)*/
unsigned short int ip_id; /*identification (標識符)*/
unsigned short int ip_off; /*fragment offset field(段移位域)*/
unsigned char ip_ttl; /*time to live (生存時間)*/
unsigned char ip_p; /*protocol(協議)*/
unsigned short int ip_sum; /*checksum(校驗和)*/
unsigned int ip_src; /*source address(源地址)*/
unsigned int ip_dst; /*destination address(目的地址)*/
}; /* total ip header length: 20 bytes (=160 bits) */

typedef struct tcpheader {
unsigned short int sport; /*source port (源埠號)*/
unsigned short int dport; /*destination port(目的埠號)*/
unsigned int th_seq; /*sequence number(包的序列號)*/
unsigned int th_ack; /*acknowledgement number(確認應答號)*/
unsigned char th_x:4; /*unused(未使用)*/
unsigned char th_off:4; /*data offset(數據偏移量)*/
unsigned char Flags; /*標志全*/
unsigned short int th_win; /*windows(窗口)*/
unsigned short int th_sum; /*checksum(校驗和)*/
unsigned short int th_urp; /*urgent pointer(緊急指針)*/
}TCP_HDR;

typedef struct udphdr {
unsigned short sport; /*source port(源埠號)*/
unsigned short dport; /*destination port(目的埠號)*/
unsigned short len; /*udp length(udp長度)*/
unsigned short cksum; /*udp checksum(udp校驗和)*/
}UDP_HDR;

void main(){

SOCKET sock;
WSADATA wsd;
DWORD dwBytesRet;
unsigned int optval = 1;
unsigned char *dataudp,*datatcp;
int i,pCount=0,lentcp, lenudp;
SOCKADDR_IN sa,saSource, saDest;
struct hostent FAR * pHostent;
char FAR name[MAX_HOSTNAME_LAN];
char szSourceIP[MAX_ADDR_LEN], szDestIP[MAX_ADDR_LEN],RecvBuf[65535] = {0};
struct udphdr *pUdpheader;
struct ipheader *pIpheader;
struct tcpheader *pTcpheader;
WSAStartup(MAKEWORD(2,1),&wsd);
if ((sock = socket(AF_INET, SOCK_RAW, IPPROTO_IP))==SOCKET_ERROR)
exit(1);
gethostname(name, MAX_HOSTNAME_LAN);
pHostent = gethostbyname(name);
sa.sin_family = AF_INET;
sa.sin_port = htons(6000);
memcpy(&sa.sin_addr.S_un.S_addr, pHostent->h_addr_list[0], pHostent->h_length);
bind(sock, (SOCKADDR *)&sa, sizeof(sa)); /*bind()設定自己主機的IP地址和埠號*/
if ((WSAGetLastError())==10013)
exit(1);
WSAIoctl(sock, SIO_RCVALL, &optval, sizeof(optval), NULL, 0, &dwBytesRet, NULL, NULL);
pIpheader = (struct ipheader *)RecvBuf;
pTcpheader = (struct tcpheader *)(RecvBuf+ sizeof(struct ipheader ));
pUdpheader = (struct udphdr *) (RecvBuf+ sizeof(struct ipheader ));

while (1){
memset(RecvBuf, 0, sizeof(RecvBuf));
recv(sock, RecvBuf, sizeof(RecvBuf), 0);
saSource.sin_addr.s_addr = pIpheader->ip_src;
strncpy(szSourceIP, inet_ntoa(saSource.sin_addr), MAX_ADDR_LEN);
saDest.sin_addr.s_addr = pIpheader->ip_dst;
strncpy(szDestIP, inet_ntoa(saDest.sin_addr), MAX_ADDR_LEN);
lentcp =(ntohs(pIpheader->ip_len)-(sizeof(struct ipheader)+sizeof(struct tcpheader)));
lenudp =(ntohs(pIpheader->ip_len)-(sizeof(struct ipheader)+sizeof(struct udphdr)));

if((pIpheader->ip_p)==IPPROTO_TCP&&lentcp!=0){
printf("*******************************************\n");
pCount++;
datatcp=(unsigned char *) RecvBuf+sizeof(struct ipheader)+sizeof(struct tcpheader);
printf("-TCP-\n");
printf("\n目的IP地址:%s\n",szDestIP);
printf("\n目的埠:%i\n",ntohs(pTcpheader->dport));
printf("datatcp address->%x\n",datatcp);
printf("size of ipheader->%i\n",sizeof(struct ipheader));
printf("size of tcpheader->%i\n",sizeof(struct tcpheader));
printf("size of the hole packet->%i\n",ntohs(pIpheader->ip_len));
printf("\nchar Packet%i [%i]=\"",pCount,lentcp-1);

for (i=0;i<lentcp;i++){
printf("\\x%.2x",*(datatcp+i));
if (i%10==0)
printf("\"\n\"");
}
printf("\";\n\n\n");

for (i=0;i<lentcp;i++){
if( *(datatcp+i)<=127&&*(datatcp+i)>=20)
printf("%c",*(datatcp+i));
else
printf(".");
}
printf("\n\n*******************************************\n");
}

if((pIpheader->ip_p)==IPPROTO_UDP&&lentcp!=0){
pCount++;
dataudp=(unsigned char *) RecvBuf+sizeof(struct ipheader)+sizeof(struct udphdr);
printf("-UDP-\n");
printf("\n目的IP地址:%s\n",szDestIP);
printf("\n目的埠:%d\n",ntohs(pTcpheader->dport));
printf("UDP數據地址:%x\n",dataudp);
printf("IP頭部長度:%i\n",sizeof(struct ipheader));
printf("UDP頭部長度:%i\n",sizeof(struct udphdr));
printf("包的大小:%i\n",ntohs(pIpheader->ip_len));
printf("\nchar Packet%i [%i]=\"",pCount,lenudp-1);
for (i=0;i<lenudp;i++){
printf("\\x%.2x",*(dataudp+i));
if (i%10==0)
printf("\"\n\"");
}
printf("\";\n\n\n");
for (i=0;i<lenudp;i++){
if( *(dataudp+i)<=127&&*(dataudp+i)>=20)
printf("%c",*(dataudp+i));
else
printf(".");
}
printf("\n\n*******************************************\n");
}
}
}

Ⅱ 計算機網路課程設計

恐怕只懸賞分就不行了吧……
1、2、3可以上網找一下,有很多源代碼
4建議你找一下WinPCAP的資料,對實現這個有很大幫助

Ⅲ 基於java的課程網路考試系統的設計與實現 論文及代碼 誰有啊,畢業設計,跪求,急啊,有什麼辦法

專業定製爬蟲,安裝版50,附源碼100,
私人編程家教300/月
大中型軟體定製
網站建設維護
畢業設計
有意回復

Ⅳ 跪求《基於Java的網路教學互動交流系統設計與實現》的源代碼!

為你提供一份針對基於Java的網路教學互動交流系統的適用於初學者的代碼,
如果你有回更多的要求也可以告答訴我們,,帶著你的問題和Email來找我,有可能幫你,但是絕對救急,使用網路_Hi給我留言,

此回復對於所有需求和和來訪者有效,
ES:\\

Ⅳ 基於.NET的教學網路輔助平台的設計與實現 本科畢業論文用asp.net與sql server 2000怎麼做

這年頭好像基本上沒有用2000的資料庫的吧

Ⅵ 求 一篇網路教學平台設計與實現的論文

可以為你來提供一份的適用於自初學者的網路教學平台設計代碼,
還有別的要求么,可以與我們聯系,,告訴我你的問題和Email,有可能幫你,不過絕對救急,請用BaiHi為我留言,

此回復針對所有來訪者和需求者有效,
ES:\\

Ⅶ 誰有《基於Java的網路教學互動交流系統設計與實現》的源代碼,謝謝,畢業設計參考用

有的話,也給我一份,謝謝,[email protected]

Ⅷ 計算機網路課程設計:TCP通信功能實現 要使用到的平台和語言有哪些

很多啊。java的最簡單。
eclipse java
visual studio c++ c/c++
只做簡單通信不難。

Ⅸ 網路教學系統的設計與實現

本文介紹了筆者承擔學校教務部的網路教學輔助系統項目的設計方案和實現技術。系統的設計目標是研發一個輔助班級授課模式的網路教學平台,作為課堂教學延伸的環境和手段,要和傳統的課堂教學相結合,更好地滿足老師和學生教與學的需求,要為課程的教學提供全過程的支持。系統實現的功能有用戶管理、課程管理、教師在線教學管理、學生在線學習、教學溝通以及網路教學論壇等。系統採用JSP動態網頁設計技術。
【作者單位】:武漢大學經濟與管理學院 武漢430000
【關鍵詞】:班級授課模式;網路教學平台;目標;功能;實現技術
【基金】:武漢大學教務部教改項目
【分類號】:TP311.52
【DOI】:cnki:ISSN:1671-4377.0.2006-05-024
【正文快照】:
隨著網路技術、多媒體技術等現代信息技術的迅猛發展,計算機輔助教學系統得到了廣泛的應用,遠程教學系統、教學網站層出不窮,網路教育也成為當今的熱點。本文介紹的系統是筆者承擔的武漢大學教務部的實踐教學改革項目,與遠程教學系統和一般的教學網站不同,目的是為目前在各類學校中占統治地位的以教師主講為中心的班級授課模式提供一個擴展的網上教學平台。一、系統設計的目標和特點網路教學輔助系統的設計目標是:研發一個輔助班級授課模式的網路教學平台,作為課堂教學延伸的環境和手段,要和傳統的課堂教學相結合,更好地滿足老師和學生教與…

Ⅹ 網路課堂系統的設計與實現

同學課題請自己好好做

閱讀全文

與網路教學平台設計與實現相關的資料

熱點內容
有趣的水語言教案反思 瀏覽:926
蘇教版高中語文pdf 瀏覽:49
幼兒觀察能力教案反思 瀏覽:927
托班音樂教案紅燈籠教學反思 瀏覽:232
怎樣讓學生愛上語文課培訓心得 瀏覽:404
山西統考2017語文試卷 瀏覽:805
三年級下冊語文半期考試jian參考答案 瀏覽:455
舞蹈課教學計劃表模板 瀏覽:682
2013小學體育教學工作計劃 瀏覽:393
快速波爾卡音樂教案 瀏覽:430
初高中語文語法 瀏覽:942
縣域課堂教學改革 瀏覽:349
何其芳秋天的教學設計 瀏覽:832
故事教學法在小學語文教學中的教學策略研究 瀏覽:795
朝陽區20152016期末語文 瀏覽:521
天勤教育教學點 瀏覽:534
語文九全課時特訓答案 瀏覽:679
戶外活動教案跑 瀏覽:977
2016重慶語文中考答案 瀏覽:885
大班音樂活動小白船教案及反思 瀏覽:216