TCP/IP

TCP 与 UDP的区别

  • TCP面向连接(如打电话要先拨号建立连接);UDP是无连接的,即发送数据之前不需要建立连接
  • TCP提供可靠的服务。也就是说,通过TCP连接传送的数据,无差错,不丢失,不重复,且按序到达;UDP尽最大努力交付,即不保 证可靠交付
  • TCP面向字节流,实际上是TCP把数据看成一连串无结构的字节流;UDP是面向报文的
    UDP没有拥塞控制,因此网络出现拥塞不会使源主机的发送速率降低(对实时应用很有用,如IP电话,实时视频会议等)
  • 每一条TCP连接只能是点到点的;UDP支持一对一,一对多,多对一和多对多的交互通信
  • TCP首部开销20字节;UDP的首部开销小,只有8个字节
  • TCP的逻辑通信信道是全双工的可靠信道,UDP则是不可靠信道
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
broadcast icmp jiqiao multi_broad raw sys_net_ml tcp1 term thread udp cap io mul_thread_download qq sem tcp tcp_dos testerr time wav ./broadcast: broad.h client.c server server.c ./cap: capture_packet capture_packet.c ./icmp: icmp.c ./io: aa ba conf filename.c fwrite.c print.c scandir.c setvbuf test tree1.c vprintf ab bb conf.c fwrite print scandir server.conf setvbuf.c tree tree.c vprintf.c ./io/test: a abb b c d ./io/test/d: e f g ./jiqiao: client client.c udp_server udp_server.c ./mul_thread_download: down.c download download-注释.c readme.txt ./multi_broad: client.c mul.h server.c ./qq: ansi_code.c client gen_single_nohead_pre.c Makefile server tcp.h ansi_code.h client.c gen_single_nohead_pre.h play_sub.c server.c ansi_code.o client.o gen_single_nohead_pre.o play_sub.h server.o ./raw: gethostbyname.c ping1.c ping.c zs.c ./sem: semget_1.c semget.c ./tcp: fork qq simple ./tcp/fork: client client.c server server.c tcp.h ./tcp/qq: client client.c gen_single_nohead_pre.h server.c client1.cv gen_single_nohead_pre.c server tcp.h ./tcp/simple: client client.c makefile server server.c tcp.h ./tcp1: fork ftp simple simple1 ./tcp1/fork: client.c server.c tcp.h ./tcp1/ftp: client.c ftp.h server.c ./tcp1/simple: client client.c makefile server server.c tcp.h ./tcp1/simple1: client1.c client2.c client.c server1.c server2.c server.c ./tcp_dos: tcp_dos tcp_dos.c ./term: getpass getpass.c gets gets.c translate ./term/translate: ansi_code.c ansi_code.o chin.c dict dict.o glist.c glist.o input.h Makefile ansi_code.h chin ciku.dict dict.c glist1.c glist.h input.c input.o tags ./testerr: testerr_copyclient.c testerr_copyserver.c testerrno_copyserver1.c ./thread: aa bping.c hello pthread_attr.c pthread_create pthread_mutex.c while.c aa.c chain hello.c pthread_attr.s pthread_create1.c pthread_rwlock aa.h cond pthread_attr pthread_cond pthread_create.c pthread_rwlock.c bping cond.c pthread_attr1.c pthread_cond.c pthread_mutex while ./thread/chain: chain_queue.c chain_queue_hanoi chain_queue.o hanoi.c main.c chain_queue.h chain_queue_hanoi.c hanoi main ./time: asctime ctime gettimeofday strftime time time.c asctime.c ctime.c gettimeofday.c strftime.c timea.c ./udp: client client_echo client_loop reliable_udp server_echo.c server_loop.c udp_server client1 client_echo.c client_loop.c server server_hello stack client1.c client_hello htonl server.c server_hello.c stack.c client.c client_hello.c htonl.c server_echo server_loop ts ./udp/reliable_udp: reliable_recv reliable_recv_std reliable_send reliable_send_std reliable_recv.c reliable_recv_std.c reliable_send.c reliable_send_std.c ./wav: exec line.c lrc_display makefile play.c playwav.c setitimer1.c getline llist.c lrc_display.c mp3 play_sub.c playwav.h setitimer.c getline.c llist.h main.c play play_sub.h setitimer ./wav/mp3:

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值