报文的概述

2024-05-09 08:24

1. 报文的概述

报文也是网络传输的单位,传输过程中会不断的封装成分组、包、帧来传输,封装的方式就是添加一些信息段,那些就是报文头以一定格式组织起来的数据。比如里面有报文类型,报文版本,报文长度,报文实体等等信息。完全与系统定义,或自定义的数据结构同义。来几个 TCP/IP 头结构感受一下:typedef struct _iphdr //定义IP首部{unsigned char h_lenver; //4位首部长度+4位IP版本号unsigned char tos; //8位服务类型TOSunsigned short total_len; //16位总长度(字节)unsigned short ident; //16位标识unsigned short frag_and_flags; //3位标志位unsigned char ttl; //8位生存时间 TTLunsigned char proto; //8位协议 (TCP, UDP 或其他)unsigned short checksum; //16位IP首部校验和unsigned int sourceIP; //32位源IP地址unsigned int destIP; //32位目的IP地址}IP_HEADER;typedef struct psd_hdr //定义TCP伪首部{unsigned long saddr; //源地址unsigned long daddr; //目的地址char mbz;char ptcl; //协议类型unsigned short tcpl; //TCP长度}PSD_HEADER;typedef struct _tcphdr //定义TCP首部{USHORT th_sport; //16位源端口USHORT th_dport; //16位目的端口unsigned int th_seq; //32位序列号unsigned int th_ack; //32位确认号unsigned char th_lenres; //4位首部长度/6位保留字unsigned char th_flag; //6位标志位USHORT th_win; //16位窗口大小USHORT th_sum; //16位校验和USHORT th_urp; //16位紧急数据偏移量}TCP_HEADER;// 这里只是数据头, 但头最能让你看清报文是啥东东// IP_HEADER::total_len 指明了实体数据(也就是真正的消息内容)长度.// 其他以此类推

报文的概述

2. 英语报可不可以用中文表示

21世纪英文报
    


Lonely voice of last loveBY CHEN XIAO 21ST CENTURY STAFFAdele, whose 2011 album 21 recently reached 30 million in worldwide sales, is still taking her time to make new music. ...
    


第1064期July 23, 2014
    
more >>
PDF版网页版
    

    


   



21英语教育
   


创造一流学习环境 打造国际化人才BY 郭心竹肖潇 武汉理工大学国际教育学院国际理财专业组组长,2013年获HND项目优秀教师奖特等奖。 为响应学院“因材施教”的倡导,我带头提倡“突重点、松弛有度”的教学方法,将每节课的课程重点挑选出来,用循序渐进的方式帮助学生们增进对知识的理解。另外,在日常的教学中,我善待每一位学 ...
   


免费第251期July 1, 2014
   
more >>
PDF版网页版
   

   


   



Teens 小学
   


Delicious banana mealBY 21ST乌干达香蕉当饭吃 Is a banana a fruit? Yes. But in Uganda (乌干达), it’s more than (不仅仅是) just a fruit. It’s a staple food (主食). People eat cooked bananas, ...
   


第434期June 24, 2014
   
more >>
PDF版网页版
   

   


   





Teens 初一
   


Don QuixoteBY 21ST堂·吉诃德(Part 2) 1. [Don Quixote and Sancho go on more adventures. In the forest they meet the Duke (公爵) and Duchess (公爵夫人).] Duke: Oh, here is Don ...
   


第470期June 30, 2014
   
more >>
PDF版网页版
   

   


   



Teens 初二
   


完成句子题技巧点拨BY Teens中考研究小组根据中文提示完成句子是考试中常见的一种题型。在这个题型中,所给出的英文句子仅为半句话,需要同学们根据中文提示,结合全句的意思,用所学过的常用词组、固定搭配或已掌握的被动语态及从句结构来完成整句话,使全句意思正确、逻辑清楚。 ...
   


第470期June 30, 2014
   
more >>
PDF版网页版
   

   


   



Teens 初三
   


文化类阅读模拟训练(一)BY 姜瑶Passage 1 Have a look in your wardrobe (衣柜). See the T-shirt and those pants with a cute cartoon character? These clothes are just some examples of pop art. ...
   


第432期May 12, 2014
   
more >>
PDF版网页版
   

   


   

3. 报文是什么东西


报文是什么东西

最新文章
热门文章
推荐阅读