Udp file transfer project - do I need error checking?

I am given the classic task of transferring files using UDP. On various resources, I read both error checking on packets (adding CRC next to the data in packets) and UDP already checks for damaged packets and discards them, so I only need to worry about retransmitting dropped packets.

Which one is correct? Do I need to manually perform integrity checks on arriving packets or are invalid packets already discarded?

The language for the project is Java, by the way.

EDIT: Some sources (study books, internet) say that the checksum covers only the header, so it ensures the correct IP address of the sender and recipient. Some sources say that the checksum also covers the data segment. Some sources say that a checksum may span a data segment, but this is optional and is determined by the OS.

EDIT 2: My professors asked, and they say that UDP error checking in the data segment is optional in IPv4, defauld in IPv6. But I still don't know if this works in programmatic control, or on the OS, or on another layer ...

+5
source share
4 answers

The first fact:

UDP 16- , 40 . ( ) 2 :

  • , , 0, " "
  • 16- sum , .

, UDP , .

:

, , : USP

  • ( )
  • ,

, UDP , , , , .

:

, , , , , , .

UDP , , TCP, UDP . , , , TCP.

, apllication .

:

, , - chunked: ( 1023 ), N .

:

  • UDP, , ( ) .
  • "/"
  • , ( )

:

  • ,
  • , , else
  • OK "/"
  • , ack, ack , "/" ( 100 ).
  • Ack , .
  • , ack, "ack/pending"

:

  • Ack, .
  • , ack, "ack/done"
  • "ack/done", , .
  • .
  • "/", - , .

:

  • chunk + N (N, ) chunk as ack/done, . , , "ack/pending" , .
  • "ack/pending" , - , ack .

, , , ack N + i, , N , .

+3

, , (.. A A, , ). CRC . UDP , , , , , , .

, A, B C , A B ( none). , C, B, A. , , TCP ( , , , , , t ) , .

UDP TCP , , . , AAC , , - . 99,9% , , . / , ( , Shoutcast TCP [ ], 't ).

, , TCP, , , , .

+2

UDP , TCP, - 16 .

UDP ( TCP), , , (, CRC-32), . ( SSL), .

, . , .

, :

TCP , , . TCP " " " ".

, , .

+2

UDP , ; CRC , , , , , ( ) , ( - ).

+1

All Articles