The constituents of the cosmic IR background (CIB) are studied at its peak wavelengths (100 and 160 um) by exploiting Herschel/PACS observations of the GOODS-N, Lockman Hole, and COSMOS fields in the PACS Evolutionary Probe (PEP) guaranteed-time survey. The GOODS-N data reach 3 sigma depths of ~3.0 mJy at 100 um and ~5.7 mJy at 160 um. At these levels, source densities are 40 and 18 beams/source, respectively, thus hitting the confusion limit at 160 um. Differential number counts extend from a few mJy up to 100-200 mJy, and are approximated as a double power law, with the break lying between 5 and 10 mJy. The available ancillary information allows us to split number counts into redshift bins. At z<=0.5 we isolate a class of luminous sources (L(IR)~1e11 Lsun), whose SEDs resemble late-spiral galaxies, peaking at ~130 um restframe and significantly colder than what is expected on the basis of pre-Herschel models. By integrating number counts over the whole covered flux range, we obtain a surface brightness of 6.36 +/- 1.67 and 6.58 +/-1.62 [nW m^-2 sr^-1] at 100 and 160 um, resolving ~45% and ~52% of the CIB, respectively. When stacking 24 um sources, the inferred CIB lies within 1.1 sigma and 0.5 sigma from direct measurements in the two bands, and fractions increase to 50% and 75%.Most of this resolved CIB fraction was radiated at z<=1.0, with 160 um sources found at higher redshift than 100 um ones.